<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;">Yes, hopefully we always see very nearly zero downtime. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I'm still not getting it, I'm sorry. Or maybe I'm getting it but I still find it really strange. So, the idea of the BTS_STAT_DOWNTIME counter, as you wrote it, is to:</p><ul><li>Be 0 or nearly 0 whenever the BTS is UP and running</li><li>Be in the range [0, BTS_DOWNTIME_SAMPLE_INTERVAL] whenever the BTS is down</li></ul><p style="white-space: pre-wrap; word-wrap: break-word;">So being it a [0, BTS_DOWNTIME_SAMPLE_INTERVAL] range, I don't see much of a use regarding the value other than signalling Up vs DOWN state, at which point maybe having a 0-1 value is good enough.</p><p style="white-space: pre-wrap; word-wrap: break-word;">In case we don't agree on the range being [0, BTS_DOWNTIME_SAMPLE_INTERVAL] per your implementation, let's, my assumptions reading the code are:</p><ul><li>bts_record_downtime() is called every BTS_DOWNTIME_SAMPLE_INTERVAL, and sets bts->last_uptime_read to now() every time, meaning that when bts_record_downtime() runs, bts->last_uptime_read will always contain at most now()-BTS_DOWNTIME_SAMPLE_INTERVAL.</li><li>if BTS is up: downtime_seconds = BTS_DOWNTIME_SAMPLE_INTERVAL - uptime_seconds = 0.</li><li>if BTS is down, it means bts->last_uptime_read was set to now() at some point in the last [0, BTS_DOWNTIME_SAMPLE_INTERVAL] interval (it cannot be less than now()-BTS_DOWNTIME_SAMPLE_INTERVAL because it would have already been updated by previous run of bts_record_downtime().</li></ul><p style="white-space: pre-wrap; word-wrap: break-word;">So please, if I'm wrong feel free to explain it to me.</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 12:38:38 +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>