From b44939a66f837bbbc4e7973bd9edb9e3a2512c71 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 26 Feb 2010 11:35:39 +0100 Subject: [PATCH] [MINOR] stats: report the request rate in frontends as cell titles The current and max request rates are now reported when the mouse flies over the session rate cur/max. The total requests is displayed with the status codes over the total sessions cell. --- src/dumpstats.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index c861ee58a..0c8ccffdb 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -1417,22 +1417,40 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) "" "" "Frontend" - /* sessions rate : current, max, limit */ - "%s%s%s" + "", + px->id, px->id); + + if (px->mode == PR_MODE_HTTP) { + chunk_printf(&msg, + /* sessions rate : current, max, limit */ + "%s%s%s" + "", + read_freq_ctr(&px->fe_req_per_sec), + U2H0(read_freq_ctr(&px->fe_sess_per_sec)), + px->counters.fe_rps_max, + U2H2(px->counters.fe_sps_max), + LIM2A2(px->fe_sps_lim, "-")); + } else { + chunk_printf(&msg, + /* sessions rate : current, max, limit */ + "%s%s%s" + "", + U2H0(read_freq_ctr(&px->fe_sess_per_sec)), + U2H1(px->counters.fe_sps_max), LIM2A2(px->fe_sps_lim, "-")); + } + + chunk_printf(&msg, /* sessions: current, max, limit */ "%s%s%s" "id, px->id, - U2H0(read_freq_ctr(&px->fe_sess_per_sec)), - U2H1(px->counters.fe_sps_max), LIM2A2(px->fe_sps_lim, "-"), U2H3(px->feconn), U2H4(px->counters.feconn_max), U2H5(px->maxconn)); /* http response (via td title): 1xx, 2xx, 3xx, 4xx, 5xx, other */ if (px->mode == PR_MODE_HTTP) { int i; - chunk_printf(&msg, " title=\"rsp codes:"); + chunk_printf(&msg, " title=\"%lld requests:", px->counters.cum_fe_req); for (i = 1; i < 6; i++) chunk_printf(&msg, " %dxx=%lld,", i, px->counters.fe.http.rsp[i]);