]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] report total number of processed connections when stopping a proxy
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Mar 2010 22:07:28 +0000 (23:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Mar 2010 22:07:28 +0000 (23:07 +0100)
It's sometimes convenient to know if a proxy has processed any connection
at all when stopping it. Since a soft restart causes the "Proxy stopped"
message to be logged for each proxy, let's add the number of connections
so that it's possible afterwards to check whether a proxy had received
any connection.

src/proxy.c

index 41bf1cf66809c7780316f378920bb8edb2611dfc..57506d9da59e113733570445a40a18e78489e0af 100644 (file)
@@ -529,8 +529,10 @@ void maintain_proxies(int *next)
                                int t;
                                t = tick_remain(now_ms, p->stop_time);
                                if (t == 0) {
-                                       Warning("Proxy %s stopped.\n", p->id);
-                                       send_log(p, LOG_WARNING, "Proxy %s stopped.\n", p->id);
+                                       Warning("Proxy %s stopped (FE: %lld conns, BE: %lld conns).\n",
+                                               p->id, p->counters.cum_feconn, p->counters.cum_beconn);
+                                       send_log(p, LOG_WARNING, "Proxy %s stopped (FE: %lld conns, BE: %lld conns).\n",
+                                                p->id, p->counters.cum_feconn, p->counters.cum_beconn);
                                        stop_proxy(p);
                                        /* try to free more memory */
                                        pool_gc2();