]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats: do not report "100%" in the thottle column when server is draining
authorWilly Tarreau <w@1wt.eu>
Tue, 13 May 2014 22:09:59 +0000 (00:09 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 13 May 2014 22:09:59 +0000 (00:09 +0200)
A condition was missing and we used to have "throttle 100%" even when
the server was draining connections, which is misleading but harmless.

src/dumpstats.c

index 13843f893b7260d30cbabc503dc9c21b40264581..5bfada7a9b924ad47c92bf80c466f73467c7f899 100644 (file)
@@ -2987,7 +2987,7 @@ static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, in
                        chunk_appendf(&trash, "<td colspan=3></td>");
 
                /* throttle */
-               if (sv->state & SRV_WARMINGUP)
+               if ((sv->state & SRV_WARMINGUP) && !server_is_draining(sv))
                        chunk_appendf(&trash, "<td class=ac>%d %%</td></tr>\n", server_throttle_rate(sv));
                else
                        chunk_appendf(&trash, "<td class=ac>-</td></tr>\n");
@@ -3065,7 +3065,7 @@ static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, in
                              relative_pid, px->uuid, sv->puid);
 
                /* throttle */
-               if (sv->state & SRV_WARMINGUP)
+               if ((sv->state & SRV_WARMINGUP) && !server_is_draining(sv))
                        chunk_appendf(&trash, "%d", server_throttle_rate(sv));
 
                /* sessions: lbtot */