iedemam has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/23234 )
Change subject: stats: add BTS uptime counter ...................................................................... Patch Set 6: (1 comment) Hi, I think it's close now. Thanks for the tips in your last comment. -Michael 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; > while I still prefer my proposal (due to what I mentioned already about > abusing stats here), I'm fin […] This comment helped me a lot. Thanks! We already have a "became_up" timestamp for each BTS and I was referencing it to set my last_uptime_read value. The problem is I was recording an interval for something that should be an absolute value. This is what led to all the interval keeping and tracking and could introduce drift. I also wasn't treating the stat_item properly. I was still using it as a counter and expecting a derive value from statsd. I've now restructured the patch to be quite minimal. Every INTERVAL seconds I set the stat_item to current elapsed uptime for that BTS. Drift should be eliminated. The stat_item is now treated as a current value and not a difference-from-last value. I've also renamed a lot of the symbols to be very clear about what we're doing here. -- 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: 6 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: Mon, 03 May 2021 14:15:28 +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
