From 748196e94bb29aeef862e4c4e1341958b803c11d Mon Sep 17 00:00:00 2001 From: Krzysztof Piotr Oledzki Date: Mon, 4 Jan 2010 00:48:43 +0100 Subject: [PATCH] [MINOR] hana: only report stats if it is enabled It is useless to report statistics if the feature was not enabled. It also makes possible to distinguish if health analyses is enabled or not only by looking at the stats page. --- src/dumpstats.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/dumpstats.c b/src/dumpstats.c index fec189a20..0751d5b8d 100644 --- a/src/dumpstats.c +++ b/src/dumpstats.c @@ -1632,14 +1632,19 @@ int stats_dump_proxy(struct session *s, struct proxy *px, struct uri_auth *uri) (sv->state & SRV_BACKUP) ? "Y" : "-"); /* check failures: unique, fatal, down time */ - if (sv->state & SRV_CHECKED) + if (sv->state & SRV_CHECKED) { + chunk_printf(&msg, "%lld", + svs->observe?"/Health Analyses":"", svs->counters.failed_checks); + + if (svs->observe) + chunk_printf(&msg, "/%lld", svs->counters.failed_hana); + chunk_printf(&msg, - "%lld/%lld" + "" "%lld%s" "", - svs->counters.failed_checks, svs->counters.failed_hana, svs->counters.down_trans, human_time(srv_downtime(sv), 1)); - else if (sv != svs) + } else if (sv != svs) chunk_printf(&msg, "via %s/%s", svs->proxy->id, svs->id); else