Change in osmo-bsc[master]: stats: add BTS uptime counter
gerrit-no-reply at lists.osmocom.org
Fri Apr 30 12:38:38 UTC 2021
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/23234 )
Change subject: stats: add BTS uptime counter
Patch Set 5:
PS4, Line 586: int downtime_seconds = BTS_DOWNTIME_SAMPLE_INTERVAL - uptime_seconds;
> Yes, hopefully we always see very nearly zero downtime. […]
I'm still not getting it, I'm sorry. Or maybe I'm getting it but I still find it really strange.
So, the idea of the BTS_STAT_DOWNTIME counter, as you wrote it, is to:
* Be 0 or nearly 0 whenever the BTS is UP and running
* Be in the range [0, BTS_DOWNTIME_SAMPLE_INTERVAL] whenever the BTS is down
So being it a [0, BTS_DOWNTIME_SAMPLE_INTERVAL] range, I don't see much of a use regarding the value other than signalling Up vs DOWN state, at which point maybe having a 0-1 value is good enough.
In case we don't agree on the range being [0, BTS_DOWNTIME_SAMPLE_INTERVAL] per your implementation, let's, my assumptions reading the code are:
- bts_record_downtime() is called every BTS_DOWNTIME_SAMPLE_INTERVAL, and sets bts->last_uptime_read to now() every time, meaning that when bts_record_downtime() runs, bts->last_uptime_read will always contain at most now()-BTS_DOWNTIME_SAMPLE_INTERVAL.
- if BTS is up: downtime_seconds = BTS_DOWNTIME_SAMPLE_INTERVAL - uptime_seconds = 0.
- if BTS is down, it means bts->last_uptime_read was set to now() at some point in the last [0, BTS_DOWNTIME_SAMPLE_INTERVAL] interval (it cannot be less than now()-BTS_DOWNTIME_SAMPLE_INTERVAL because it would have already been updated by previous run of bts_record_downtime().
So please, if I'm wrong feel free to explain it to me.
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/23234
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Owner: iedemam <michael at kapsulate.com>
Gerrit-Assignee: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-CC: dexter <pmaier at sysmocom.de>
Gerrit-Comment-Date: Fri, 30 Apr 2021 12:38:38 +0000
Comment-In-Reply-To: iedemam <michael at kapsulate.com>
Comment-In-Reply-To: pespin <pespin at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gerrit-log