From e7150cdcfa7b3150f61a3d8b55a97b8976f1e14e Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 25 Jul 2007 14:43:32 +0200 Subject: [PATCH] [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. --- include/types/session.h | 3 ++ src/proto_http.c | 87 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 80 insertions(+), 10 deletions(-) diff --git a/include/types/session.h b/include/types/session.h index 819acfd74..a76861912 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 8ebdc6116..7a86d1159 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: