<p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/23234">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/23234/4/src/osmo-bsc/bts.c">File src/osmo-bsc/bts.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/23234/4/src/osmo-bsc/bts.c@586">Patch Set #4, Line 586:</a> <code style="font-family:monospace,monospace">      int downtime_seconds = BTS_DOWNTIME_SAMPLE_INTERVAL - uptime_seconds;</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I appreciate the suggestion but this is now even more complicated. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">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:<br>"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"</p><p style="white-space: pre-wrap; word-wrap: break-word;">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).<br>And of course if the BTS is down whenever the callback is called, set the stat to 0 or -1 or whatever :)</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-bsc/+/23234">change 23234</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-bsc/+/23234"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-bsc </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ib17674bbe95e828cebff12de9e0b30f06447ef6c </div>
<div style="display:none"> Gerrit-Change-Number: 23234 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: iedemam <michael@kapsulate.com> </div>
<div style="display:none"> Gerrit-Assignee: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 30 Apr 2021 18:22:08 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: iedemam <michael@kapsulate.com> </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>