aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2022-12-02 21:29:06 +0300
committermsuraev <msuraev@sysmocom.de>2022-12-19 15:51:42 +0000
commit23a7d0740c7879b5c6d1f883b6a999359932547b (patch)
tree4eec6bcc6664a0b0f76462a155a9642fa84f0271 /src
parent6db830f31677a7220a28560639fbf5b3839889a4 (diff)
rate_ctr: drop rate estimation code
Drop the code which tried to estimate the value for the next timeframe: it accumulated error over time which only adds confusion. N. B: this means that long-term intervals (day, hour) will show the rate of 0 until corresponding timeframe passes. This matches how other monitoring software [1] behaves. [1] https://learn.netdata.cloud Fixes: OS#5671 Change-Id: I07232e9ff8bd62403ae82d9bd60d967d40b54ebc
Diffstat (limited to 'src')
-rw-r--r--src/rate_ctr.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 3fc49922..44e26585 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -306,11 +306,6 @@ static void interval_expired(struct rate_ctr *ctr, enum rate_ctr_intv intv)
ctr->intv[intv].rate = ctr->current - ctr->intv[intv].last;
/* save current counter for next interval */
ctr->intv[intv].last = ctr->current;
-
- /* update the rate of the next bigger interval. This will
- * be overwritten when that next larger interval expires */
- if (intv + 1 < ARRAY_SIZE(ctr->intv))
- ctr->intv[intv+1].rate += ctr->intv[intv].rate;
}
static struct osmo_fd rate_ctr_timer = { .fd = -1 };