msuraev submitted this change.

View Change

Approvals: laforge: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve msuraev: Looks good to me, approved Jenkins Builder: Verified
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
---
M src/rate_ctr.c
1 file changed, 0 insertions(+), 5 deletions(-)

diff --git a/src/rate_ctr.c b/src/rate_ctr.c
index 3fc4992..44e2658 100644
--- a/src/rate_ctr.c
+++ b/src/rate_ctr.c
@@ -306,11 +306,6 @@
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 };

To view, visit change 30304. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I07232e9ff8bd62403ae82d9bd60d967d40b54ebc
Gerrit-Change-Number: 30304
Gerrit-PatchSet: 26
Gerrit-Owner: msuraev <msuraev@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: msuraev <msuraev@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged