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.
This commit is contained in:
parent
fe0a87a588
commit
eb023ff1d9
9
net_io.c
9
net_io.c
|
@ -907,16 +907,13 @@ char *generateStatsJson(const char *url_path, int *len) {
|
||||||
p = appendStatsJson(p, end, &Modes.stats_current, "latest");
|
p = appendStatsJson(p, end, &Modes.stats_current, "latest");
|
||||||
p += snprintf(p, end-p, ",\n");
|
p += snprintf(p, end-p, ",\n");
|
||||||
|
|
||||||
add_stats(&Modes.stats_1min[Modes.stats_latest_1min], &Modes.stats_current, &add);
|
p = appendStatsJson(p, end, &Modes.stats_1min[Modes.stats_latest_1min], "last1min");
|
||||||
p = appendStatsJson(p, end, &add, "last1min");
|
|
||||||
p += snprintf(p, end-p, ",\n");
|
p += snprintf(p, end-p, ",\n");
|
||||||
|
|
||||||
add_stats(&Modes.stats_5min, &Modes.stats_current, &add);
|
p = appendStatsJson(p, end, &Modes.stats_5min, "last5min");
|
||||||
p = appendStatsJson(p, end, &add, "last5min");
|
|
||||||
p += snprintf(p, end-p, ",\n");
|
p += snprintf(p, end-p, ",\n");
|
||||||
|
|
||||||
add_stats(&Modes.stats_15min, &Modes.stats_current, &add);
|
p = appendStatsJson(p, end, &Modes.stats_15min, "last15min");
|
||||||
p = appendStatsJson(p, end, &add, "last15min");
|
|
||||||
p += snprintf(p, end-p, ",\n");
|
p += snprintf(p, end-p, ",\n");
|
||||||
|
|
||||||
add_stats(&Modes.stats_alltime, &Modes.stats_current, &add);
|
add_stats(&Modes.stats_alltime, &Modes.stats_current, &add);
|
||||||
|
|
Loading…
Reference in a new issue