From b685ad0774a6b4040f0422b4f3c2ddae9de0cade Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 10 Feb 2023 16:53:35 +0100 Subject: [PATCH] BUG/MINOR: clock/stats: also use start_time not start_date in HTML info 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stats.c b/src/stats.c index 9866a5474..4ee8e868a 100644 --- a/src/stats.c +++ b/src/stats.c @@ -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;