]> git.kaiwu.me - haproxy.git/commitdiff
[BUG] stats: total and lbtot are unsigned
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Apr 2009 11:27:40 +0000 (13:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 10 May 2009 15:49:05 +0000 (17:49 +0200)
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.

src/dumpstats.c

index 894c2487d8b556e43dc5bad552346e09e7130b6b..b5ecddc143fd48cea8729774d3dcb7eb650dc4f0 100644 (file)
@@ -699,7 +699,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 */
@@ -871,7 +871,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 */
@@ -930,7 +930,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);
 
                                /* tracked */
                                if (sv->tracked)
@@ -1004,7 +1004,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 */
@@ -1022,7 +1022,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, tracked, type */
-                                    "%d,%d,0,,%d,,%d,"
+                                    "%d,%d,0,,%u,,%d,"
                                     "\n",
                                     px->id,
                                     px->nbpend /* or px->totpend ? */, px->nbpend_max,