]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: activity: group the per-loop counters at the top
authorWilly Tarreau <w@1wt.eu>
Wed, 17 Jun 2020 18:44:28 +0000 (20:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Jun 2020 18:52:29 +0000 (20:52 +0200)
empty_rq and long_rq are per-loop so it makes sense to group them
together with the loop count. In addition since ctxsw and tasksw
apply in the context of these counters, let's move them as well.
More precisely the difference between wake_tasks and long_rq should
roughly correspond to the number of inter-task messages. Visually
it's much easier to spot ratios of wakeup causes now.

src/cli.c

index 528f93560837388c66293d7c0a670cccc81ac0ca..cbc61369fa7d2ecf2ca3e8e77b340ced5b7b25a7 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1126,6 +1126,10 @@ static int cli_io_handler_show_activity(struct appctx *appctx)
 
        chunk_appendf(&trash, "thread_id: %u (%u..%u)\n", tid + 1, 1, global.nbthread);
        chunk_appendf(&trash, "date_now: %lu.%06lu\n", (long)now.tv_sec, (long)now.tv_usec);
+       chunk_appendf(&trash, "ctxsw:");        SHOW_TOT(thr, activity[thr].ctxsw);
+       chunk_appendf(&trash, "tasksw:");       SHOW_TOT(thr, activity[thr].tasksw);
+       chunk_appendf(&trash, "empty_rq:");     SHOW_TOT(thr, activity[thr].empty_rq);
+       chunk_appendf(&trash, "long_rq:");      SHOW_TOT(thr, activity[thr].long_rq);
        chunk_appendf(&trash, "loops:");        SHOW_TOT(thr, activity[thr].loops);
        chunk_appendf(&trash, "wake_tasks:");   SHOW_TOT(thr, activity[thr].wake_tasks);
        chunk_appendf(&trash, "wake_signal:");  SHOW_TOT(thr, activity[thr].wake_signal);
@@ -1138,10 +1142,6 @@ static int cli_io_handler_show_activity(struct appctx *appctx)
        chunk_appendf(&trash, "stream:");       SHOW_TOT(thr, activity[thr].stream);
        chunk_appendf(&trash, "pool_fail:");    SHOW_TOT(thr, activity[thr].pool_fail);
        chunk_appendf(&trash, "buf_wait:");     SHOW_TOT(thr, activity[thr].buf_wait);
-       chunk_appendf(&trash, "empty_rq:");     SHOW_TOT(thr, activity[thr].empty_rq);
-       chunk_appendf(&trash, "long_rq:");      SHOW_TOT(thr, activity[thr].long_rq);
-       chunk_appendf(&trash, "ctxsw:");        SHOW_TOT(thr, activity[thr].ctxsw);
-       chunk_appendf(&trash, "tasksw:");       SHOW_TOT(thr, activity[thr].tasksw);
        chunk_appendf(&trash, "cpust_ms_tot:"); SHOW_TOT(thr, activity[thr].cpust_total / 2);
        chunk_appendf(&trash, "cpust_ms_1s:");  SHOW_TOT(thr, read_freq_ctr(&activity[thr].cpust_1s) / 2);
        chunk_appendf(&trash, "cpust_ms_15s:"); SHOW_TOT(thr, read_freq_ctr_period(&activity[thr].cpust_15s, 15000) / 2);