From: Krzysztof Piotr Oledzki Date: Thu, 22 Oct 2009 20:48:09 +0000 (+0200) Subject: [MINOR] Add "a name" to stats page X-Git-Tag: v1.4-dev5~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=516ed499640abb9bbe9ed8be9d63e4b69f7aa895;p=thirdparty%2Fhaproxy.git [MINOR] Add "a name" to stats page If you have a lot of proxies/servers in your stats page it is not easy to locate the one you are interested in. You can of couse use search function from you favorite web browser but browsers often lost their focus when reloading stats. This patch adds html tags for proxies, frontends, servers and backends. You can use it to access a specific place, for example: http://(stats_url)#proxy http://(stats_url)#proxy/Frontend http://(stats_url)#proxy/server1 http://(stats_url)#proxy/server2 http://(stats_url)#proxy/Backend --- diff --git a/src/dumpstats.c b/src/dumpstats.c index f140bbf8b6..70b96b5af8 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -1224,7 +1224,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) chunk_printf(&msg, "\n" "" - "" + "" "" "\n" "
%s%s%s
\n" @@ -1247,7 +1247,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) "BckChkDwnDwntme" "Thrtle\n" "", - px->id, + px->id, px->id, px->desc ? "desc" : "empty", px->desc ? px->desc : ""); if (buffer_feed_chunk(rep, &msg) >= 0) @@ -1264,7 +1264,8 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) if (!(s->data_ctx.stats.flags & STAT_FMT_CSV)) { chunk_printf(&msg, /* name, queue */ - "Frontend" + "" + "
Frontend" /* sessions rate : current, max, limit */ "%s%s%s" /* sessions : current, max, limit, total, lbtot */ @@ -1273,6 +1274,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) /* bytes : in, out */ "%s%s" "", + 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), @@ -1489,7 +1491,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) "no check" }; chunk_printf(&msg, /* name */ - "%s" + "%s" /* queue : current, max, limit */ "%s%s%s" /* sessions rate : current, max, limit */ @@ -1499,7 +1501,7 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) "state & SRV_BACKUP) ? "backup" : "active", - sv_state, sv->id, + sv_state, px->id, sv->id, sv->id, U2H0(sv->nbpend), U2H1(sv->counters.nbpend_max), LIM2A2(sv->maxqueue, "-"), U2H3(read_freq_ctr(&sv->sess_per_sec)), U2H4(sv->counters.sps_max), U2H5(sv->cur_sess), U2H6(sv->counters.cur_sess_max), LIM2A7(sv->maxconn, "-")); @@ -1746,12 +1748,14 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) if (!(s->data_ctx.stats.flags & STAT_FMT_CSV)) { chunk_printf(&msg, /* name */ - "Backend" + "" + "Backend" /* queue : current, max */ "%s%s" /* sessions rate : current, max, limit */ "%s%s" "", + px->id, U2H0(px->nbpend) /* or px->totpend ? */, U2H1(px->counters.nbpend_max), U2H2(read_freq_ctr(&px->be_sess_per_sec)), U2H3(px->counters.be_sps_max));