Add broker and web throughput diagnostics

This commit is contained in:
2026-09-08 22:40:58 +02:00
parent 36d41be422
commit 042499e4d6
20 changed files with 899 additions and 5 deletions
@@ -44,6 +44,7 @@ static void vTaskDelay(unsigned delay) { assert(delay==100); ++waits; }
#define pdMS_TO_TICKS(ms) (ms)
static void print_usage(void) { ++usages; }
static int web_diagnostics_command(const char *action) { assert(!strcmp(action, "show")); return 0; }
static int performance_command(const char *action) { return strcmp(action, "show") ? 1 : 0; }
static int show_status(void) { assert(false); return 1; }
static int show_counters(void) { assert(false); return 1; }
static int show_certificate(void) { assert(false); return 1; }
@@ -69,6 +70,11 @@ int main(void) {
remote=web=false;
char *diagnostics[]={"web", "diagnostics", "show"};
assert(command_web(3, diagnostics)==0 && !stops && !scheduled);
char *performance[]={"web", "performance", "show", "extra"};
assert(command_web(3, performance)==0 && !stops && !scheduled);
assert(command_web(4, performance)==1 && !stops && !scheduled);
performance[2]="invalid";
assert(command_web(3, performance)==1 && !stops && !scheduled);
char *stop[]={"web", "stop"};
remote=web=true;
assert(command_web(2,stop)==0 && scheduled==1 && !stops && last_action==ADMIN_CONSOLE_DEFER_WEB_STOP);