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: (1 comment) https://gerrit.osmocom.org/c/osmo-bsc/+/23234/4/src/osmo-bsc/bts.c File src/osmo-bsc/bts.c: https://gerrit.osmocom.org/c/osmo-bsc/+/23234/4/src/osmo-bsc/bts.c@586 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 https://gerrit.osmocom.org/c/osmo-bsc/+/23234 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: Ib17674bbe95e828cebff12de9e0b30f06447ef6c Gerrit-Change-Number: 23234 Gerrit-PatchSet: 5 Gerrit-Owner: iedemam <[email protected]> Gerrit-Assignee: daniel <[email protected]> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <[email protected]> Gerrit-Reviewer: laforge <[email protected]> Gerrit-Reviewer: pespin <[email protected]> Gerrit-CC: dexter <[email protected]> Gerrit-Comment-Date: Fri, 30 Apr 2021 18:22:08 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: iedemam <[email protected]> Comment-In-Reply-To: pespin <[email protected]> Gerrit-MessageType: comment
