From 61c6169be1879f8629e4cb9027a93e8881079012 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 7 Apr 2009 13:27:40 +0200 Subject: [PATCH] [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) --- src/dumpstats.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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, -- 2.47.3