]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: also report the nice and number of calls for applets
authorWilly Tarreau <w@1wt.eu>
Thu, 31 May 2018 12:40:19 +0000 (14:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Jun 2018 09:18:21 +0000 (11:18 +0200)
Since applets are now part of the main scheduler, it's useful to report
their nice value and the number of calls to the applet handler, to see
where the CPU is spent.

src/stream.c

index 7ad84e993cd4686498e2bb4c702b49c36b51c2a2..9fdf6621b3c3cd65c7463f45782e4b2f243a100e 100644 (file)
@@ -2911,13 +2911,14 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                }
                else if ((tmpctx = objt_appctx(strm->si[0].end)) != NULL) {
                        chunk_appendf(&trash,
-                                     "  app0=%p st0=%d st1=%d st2=%d applet=%s tmask=0x%lx\n",
+                                     "  app0=%p st0=%d st1=%d st2=%d applet=%s tmask=0x%lx nice=%d calls=%u\n",
                                      tmpctx,
                                      tmpctx->st0,
                                      tmpctx->st1,
                                      tmpctx->st2,
                                      tmpctx->applet->name,
-                                     tmpctx->thread_mask);
+                                     tmpctx->thread_mask,
+                                     tmpctx->t->nice, tmpctx->t->calls);
                }
 
                if ((cs = objt_cs(strm->si[1].end)) != NULL) {
@@ -2944,13 +2945,14 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st
                }
                else if ((tmpctx = objt_appctx(strm->si[1].end)) != NULL) {
                        chunk_appendf(&trash,
-                                     "  app1=%p st0=%d st1=%d st2=%d applet=%s tmask=0x%lx\n",
+                                     "  app1=%p st0=%d st1=%d st2=%d applet=%s tmask=0x%lx, nice=%d, calls=%u\n",
                                      tmpctx,
                                      tmpctx->st0,
                                      tmpctx->st1,
                                      tmpctx->st2,
                                      tmpctx->applet->name,
-                                     tmpctx->thread_mask);
+                                     tmpctx->thread_mask,
+                                     tmpctx->t->nice, tmpctx->t->calls);
                }
 
                chunk_appendf(&trash,