]> 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 16:19:22 +0000 (18:19 +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.

(cherry-picked from commit 1e8e543c67118c408015698782f4691d9faf96d1)

src/dumpstats.c

index fc45d4926d580f7cb809bd5b3a279f5a5f891658..9afec3305bd386d80ebd6b7afa8023d418b28b7a 100644 (file)
@@ -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,