From: Willy Tarreau Date: Tue, 7 Apr 2009 11:27:40 +0000 (+0200) Subject: [BUG] stats: total and lbtot are unsigned X-Git-Tag: v1.3.14.13~8 X-Git-Url: http://git.kaiwu.me/%7B@url%7D?a=commitdiff_plain;h=61c6169be1879f8629e4cb9027a93e8881079012;p=haproxy.git [BUG] stats: total and lbtot are unsigned Some big users are seeing negative numbers in the CSV stats. This patch needs to be backported to 1.3.15 and extended to the HTML part. (cherry-picked from commit 1e8e543c67118c408015698782f4691d9faf96d1) --- diff --git a/src/dumpstats.c b/src/dumpstats.c index fc45d4926..9afec3305 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -690,7 +690,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) /* pxid, name, queue cur, queue max, */ "%s,FRONTEND,,," /* sessions : current, max, limit, total */ - "%d,%d,%d,%d," + "%d,%d,%d,%u," /* bytes : in, out */ "%lld,%lld," /* denied: req, resp */ @@ -845,7 +845,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) /* queue : current, max */ "%d,%d," /* sessions : current, max, limit, total */ - "%d,%d,%s,%d," + "%d,%d,%s,%u," /* bytes : in, out */ "%lld,%lld," /* denied: req, resp */ @@ -904,7 +904,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) } /* sessions: lbtot */ - chunk_printf(&msg, sizeof(trash), ",%d", sv->cum_lbconn); + chunk_printf(&msg, sizeof(trash), ",%u", sv->cum_lbconn); /* ',' then EOL */ chunk_printf(&msg, sizeof(trash), ",\n"); } @@ -971,7 +971,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) /* queue : current, max */ "%d,%d," /* sessions : current, max, limit, total */ - "%d,%d,%d,%d," + "%d,%d,%d,%u," /* bytes : in, out */ "%lld,%lld," /* denied: req, resp */ @@ -989,7 +989,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) /* rest of backend: nothing, down transitions, last change, total downtime */ ",%d,%d,%d,," /* pid, iid, sid, throttle, lbtot, */ - "%d,%d,0,,%d," + "%d,%d,0,,%u," "\n", px->id, px->nbpend /* or px->totpend ? */, px->nbpend_max,