From: Krzysztof Piotr Oledzki Date: Sun, 3 Jan 2010 23:48:43 +0000 (+0100) Subject: [MINOR] hana: only report stats if it is enabled X-Git-Tag: v1.4-dev6~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=748196e94bb29aeef862e4c4e1341958b803c11d;p=thirdparty%2Fhaproxy.git [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. --- diff --git a/src/dumpstats.c b/src/dumpstats.c index fec189a203..0751d5b8dd 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