]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: clock/stats: also use start_time not start_date in HTML info
authorWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2023 15:53:35 +0000 (16:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2023 15:53:35 +0000 (16:53 +0100)
For an unknown reason in the change of uptime calculation for the HTML
page didn't make it to commit 6093ba47c ("BUG/MINOR: clock: do not mix
wall-clock and monotonic time in uptime calculation"). Let's address it
as well otherwise the stats page will display an incorrect uptime.

No backport needed unless the patch above is backported.

src/stats.c

index 9866a54747d64168a46bc6abb78884bb61732e36..4ee8e868a8cb72d88e71e51989c9cbb8796469bb 100644 (file)
@@ -3537,7 +3537,7 @@ static void stats_dump_html_info(struct stconn *sc, struct uri_auth *uri)
 {
        struct appctx *appctx = __sc_appctx(sc);
        struct show_stat_ctx *ctx = appctx->svcctx;
-       unsigned int up = (now.tv_sec - start_date.tv_sec);
+       unsigned int up = (now.tv_sec - start_time.tv_sec);
        char scope_txt[STAT_SCOPE_TXT_MAXLEN + sizeof STAT_SCOPE_PATTERN];
        const char *scope_ptr = stats_scope_ptr(appctx, sc);
        unsigned long long bps;