]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] stats: report the current and max global connection rates
authorWilly Tarreau <w@1wt.eu>
Wed, 7 Sep 2011 13:26:48 +0000 (15:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Sep 2011 20:47:42 +0000 (22:47 +0200)
The HTML page reports the current process connection rate, and the
"show info" command on the stats socket also reports the conn rate
limit and the max conn rate that was once reached.

Note that the max value can be cleared using "clear counters".

src/dumpstats.c

index 4fde2919a95c324e196533139c498121b6fed8df..73d5ad649eaba8e57f61cdffd8a65be7fedb5d56 100644 (file)
@@ -1433,6 +1433,9 @@ static int stats_dump_raw_to_buffer(struct stream_interface *si)
                                     "CurrConns: %d\n"
                                     "PipesUsed: %d\n"
                                     "PipesFree: %d\n"
+                                    "ConnRate: %d\n"
+                                    "ConnRateLimit: %d\n"
+                                    "MaxConnRate: %d\n"
                                     "Tasks: %d\n"
                                     "Run_queue: %d\n"
                                     "node: %s\n"
@@ -1447,6 +1450,7 @@ static int stats_dump_raw_to_buffer(struct stream_interface *si)
                                     global.rlimit_nofile,
                                     global.maxsock, global.maxconn, global.hardmaxconn, global.maxpipes,
                                     actconn, pipes_used, pipes_free,
+                                    read_freq_ctr(&global.conn_per_sec), global.cps_lim, global.cps_max,
                                     nb_tasks_cur, run_queue_cur,
                                     global.node, global.desc?global.desc:""
                                     );
@@ -1762,7 +1766,7 @@ static int stats_dump_http(struct stream_interface *si, struct uri_auth *uri)
                             "<b>uptime = </b> %dd %dh%02dm%02ds<br>\n"
                             "<b>system limits:</b> memmax = %s%s; ulimit-n = %d<br>\n"
                             "<b>maxsock = </b> %d; <b>maxconn = </b> %d; <b>maxpipes = </b> %d<br>\n"
-                            "current conns = %d; current pipes = %d/%d<br>\n"
+                            "current conns = %d; current pipes = %d/%d; conn rate = %d/sec<br>\n"
                             "Running tasks: %d/%d<br>\n"
                             "</td><td align=\"center\" nowrap>\n"
                             "<table class=\"lgd\"><tr>\n"
@@ -1795,7 +1799,7 @@ static int stats_dump_http(struct stream_interface *si, struct uri_auth *uri)
                             global.rlimit_memmax ? " MB" : "",
                             global.rlimit_nofile,
                             global.maxsock, global.maxconn, global.maxpipes,
-                            actconn, pipes_used, pipes_used+pipes_free,
+                            actconn, pipes_used, pipes_used+pipes_free, read_freq_ctr(&global.conn_per_sec),
                             run_queue_cur, nb_tasks_cur
                             );