]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: prepend '*' in front of the check status when in progress
authorWilly Tarreau <w@1wt.eu>
Fri, 8 Jan 2016 08:43:54 +0000 (09:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 Mar 2016 16:08:05 +0000 (17:08 +0100)
The HTML version already does this, but the CSV doesn't provide this
status, so make both of them report the same status.

src/dumpstats.c

index c2a2c55028abba366e7052f3b1c53a909fb09d98..fce8d90a3f9cab80f320815af28ded73f7877ec9 100644 (file)
@@ -3733,7 +3733,10 @@ static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, in
                const char *fld_chksts;
 
                fld_chksts = chunk_newstr(out);
+               chunk_strcat(out, "* "); // for check in progress
                chunk_strcat(out, get_check_status_info(sv->check.status));
+               if (!(sv->check.state & CHK_ST_INPROGRESS))
+                       fld_chksts += 2; // skip "* "
                stats[ST_F_CHECK_STATUS] = mkf_str(FN_OUTPUT, fld_chksts);
 
                if (sv->check.status >= HCHK_STATUS_L57DATA)
@@ -3975,8 +3978,7 @@ static int stats_dump_sv_stats(struct stream_interface *si, struct proxy *px, in
                }
                else if ((sv->check.state & (CHK_ST_ENABLED|CHK_ST_PAUSED)) == CHK_ST_ENABLED) {
                        chunk_appendf(&trash,
-                                     "</td><td class=ac><u> %s%s",
-                                     (sv->check.state & CHK_ST_INPROGRESS) ? "* " : "",
+                                     "</td><td class=ac><u> %s",
                                      field_str(stats, ST_F_CHECK_STATUS));
 
                        if (stats[ST_F_CHECK_CODE].type)