From eb023ff1d9869e910906919db2d02057e5f3b17d Mon Sep 17 00:00:00 2001 From: Oliver Jowett Date: Thu, 22 Jan 2015 20:45:53 +0000 Subject: [PATCH] Don't include latest in 1/5/15 min totals, it's a bit confusing. This means the 1/5/15 min values may reflect a period that ended up to 1 minute ago, but the length of the measured period is always as expected i.e. 1/5/15 mins. --- net_io.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net_io.c b/net_io.c index 63d9489..16354e7 100644 --- a/net_io.c +++ b/net_io.c @@ -907,16 +907,13 @@ char *generateStatsJson(const char *url_path, int *len) { p = appendStatsJson(p, end, &Modes.stats_current, "latest"); p += snprintf(p, end-p, ",\n"); - add_stats(&Modes.stats_1min[Modes.stats_latest_1min], &Modes.stats_current, &add); - p = appendStatsJson(p, end, &add, "last1min"); + p = appendStatsJson(p, end, &Modes.stats_1min[Modes.stats_latest_1min], "last1min"); p += snprintf(p, end-p, ",\n"); - add_stats(&Modes.stats_5min, &Modes.stats_current, &add); - p = appendStatsJson(p, end, &add, "last5min"); + p = appendStatsJson(p, end, &Modes.stats_5min, "last5min"); p += snprintf(p, end-p, ",\n"); - add_stats(&Modes.stats_15min, &Modes.stats_current, &add); - p = appendStatsJson(p, end, &add, "last15min"); + p = appendStatsJson(p, end, &Modes.stats_15min, "last15min"); p += snprintf(p, end-p, ",\n"); add_stats(&Modes.stats_alltime, &Modes.stats_current, &add);