]> git.ipfire.org Git - thirdparty/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>
Tue, 7 Apr 2009 11:27:40 +0000 (13:27 +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 a4e80c217346b902611056abc32a2cda33d6ce4c..b132f717404052e97bed521c9df4119d2c20d057 100644 (file)
@@ -728,7 +728,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 */
@@ -907,7 +907,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 */
@@ -966,7 +966,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)
@@ -1052,7 +1052,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 */
@@ -1070,7 +1070,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,"
                                     /* rate */
                                     "%u,"
                                     "\n",