Change in osmo-bsc[master]: stats: add BTS uptime counter

pespin gerrit-no-reply at
Fri Apr 30 18:22:08 UTC 2021

pespin has posted comments on this change. ( )

Change subject: stats: add BTS uptime counter

Patch Set 5:

(1 comment) 
File src/osmo-bsc/bts.c: 
PS4, Line 586: 	int downtime_seconds = BTS_DOWNTIME_SAMPLE_INTERVAL - uptime_seconds;
> I appreciate the suggestion but this is now even more complicated. […]
while I still prefer my proposal (due to what I mentioned already about abusing stats here), I'm fine with counting uptime as you want. IIRC my important comment a while ago regarding that "counting uptime" was on how you planned to do it, which you are describing again in your last comment:
"Can we go back to the initial proposal? Every X seconds, I add X seconds of uptime to the uptime counter stored in a stat_item. Done"

Adding X every time easily leads to drifting. Why not simply storing a "became_up" timestamp in each struct bts whenever the BTS becomes up, and then every X seconds do osmo_stat_item_set(bts->bts_statg->items[BTS_STAT_DOWNTIME], now()-became_up).
And of course if the BTS is down whenever the callback is called, set the stat to 0 or -1 or whatever :)

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ib17674bbe95e828cebff12de9e0b30f06447ef6c
Gerrit-Change-Number: 23234
Gerrit-PatchSet: 5
Gerrit-Owner: iedemam <michael at>
Gerrit-Assignee: daniel <dwillmann at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann at>
Gerrit-Reviewer: laforge <laforge at>
Gerrit-Reviewer: pespin <pespin at>
Gerrit-CC: dexter <pmaier at>
Gerrit-Comment-Date: Fri, 30 Apr 2021 18:22:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: iedemam <michael at>
Comment-In-Reply-To: pespin <pespin at>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list