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

pespin gerrit-no-reply at lists.osmocom.org
Wed Apr 28 10:24:05 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 4: Code-Review-1

(3 comments)

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@571 
PS4, Line 571: 	if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) {
osmo_clock_gettime


https://gerrit.osmocom.org/c/osmo-bsc/+/23234/4/src/osmo-bsc/bts.c@580 
PS4, Line 580: 	if (uptime_seconds < 0) {
This cannot happen with a monotonic clock? Unless you run for crazy amount of years without reboot which seems not plausible.


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;
There's something here I'm not really following. I have the impression the state will always end up being around 0.

So every BTS_DOWNTIME_SAMPLE_INTERVAL you trigger the timer which calls this function bts_record_downtime(). Then you get now(), substract it from last_uptime_read and then substract BTS_DOWNTIME_SAMPLE_INTERVAL which would give always around0 (because you end up updating last_uptime_read at the end of the function).



-- 
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: 4
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: Wed, 28 Apr 2021 10:24:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210428/af701b3a/attachment.htm>


More information about the gerrit-log mailing list