From: Willy Tarreau Date: Wed, 25 Jul 2007 12:43:32 +0000 (+0200) Subject: [MEDIUM] stats page: added links for 'refresh' and 'hide down' X-Git-Tag: v1.3.13~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7150cdcfa7b3150f61a3d8b55a97b8976f1e14e;p=thirdparty%2Fhaproxy.git [MEDIUM] stats page: added links for 'refresh' and 'hide down' The stats page now supports an option to hide servers which are DOWN and to enable/disable automatic refresh. It is also possible to ask for an immediate refresh. --- diff --git a/include/types/session.h b/include/types/session.h index 819acfd74a..a76861912c 100644 --- a/include/types/session.h +++ b/include/types/session.h @@ -74,6 +74,9 @@ #define SN_FINST_SHIFT 12 /* bit shift */ /* unused: 0x00008000 */ +#define SN_STAT_HIDEDWN 0x00010000 /* hide 'down' servers in the stats page */ +#define SN_STAT_NORFRSH 0x00020000 /* do not automatically refresh the stats page */ + /* WARNING: if new fields are added, they must be initialized in event_accept() * and freed in session_free() ! diff --git a/src/proto_http.c b/src/proto_http.c index 8ebdc6116a..7a86d11593 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -3453,7 +3453,7 @@ int produce_content_stats(struct session *s) "Connection: close\r\n" "Content-Type: text/html\r\n"); - if (s->be->uri_auth->refresh > 0) + if (s->be->uri_auth->refresh > 0 && !(s->flags & SN_STAT_NORFRSH)) chunk_printf(&msg, sizeof(trash), "Refresh: %d\r\n", s->be->uri_auth->refresh); @@ -3569,7 +3569,7 @@ int produce_content_stats(struct session *s) "

Statistics Report for pid %d

\n" "
\n" "

> General process information

\n" - "" - "" - "
\n" + "" "
\n" "

pid = %d (nbproc = %d)
\n" "uptime = %dd %dh%02dm%02ds
\n" "system limits : memmax = %s%s ; ulimit-n = %d
\n" @@ -3590,14 +3590,8 @@ int produce_content_stats(struct session *s) "

not checked
\n" "
" - "External ressources:" - "
\n" + "" + "Display option: