]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] hana: only report stats if it is enabled
authorKrzysztof Piotr Oledzki <ole@ans.pl>
Sun, 3 Jan 2010 23:48:43 +0000 (00:48 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 5 Jan 2010 23:28:05 +0000 (00:28 +0100)
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

index fec189a2035bb6b174045c461bf71834d0bf0d45..0751d5b8dd77b16d06906bbb5d861ca7a411413f 100644 (file)
@@ -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, "<td title=\"Failed Health Checks%s\">%lld",
+                                            svs->observe?"/Health Analyses":"", svs->counters.failed_checks);
+
+                                       if (svs->observe)
+                                               chunk_printf(&msg, "/%lld", svs->counters.failed_hana);
+
                                        chunk_printf(&msg,
-                                            "<td title=\"Failed Health Checks/Health Analyses\">%lld/%lld</td>"
+                                            "</td>"
                                             "<td>%lld</td><td>%s</td>"
                                             "",
-                                            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,
                                             "<td class=ac colspan=3>via %s/%s</td>", svs->proxy->id, svs->id);
                                else