<p style="white-space: pre-wrap; word-wrap: break-word;">Hi Pepsin,</p><p style="white-space: pre-wrap; word-wrap: break-word;">Thanks for the review. I've addressed the first two items. The third has hopefully been explained better now but I'm open to suggestions.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Regards,<br>-Michael</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/23234">View Change</a></p><p>3 comments:</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@571">Patch Set #4, Line 571:</a> <code style="font-family:monospace,monospace">       if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">osmo_clock_gettime</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Oops, sorry. I missed this from a previous comment. Fixed now.</p></li><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@580">Patch Set #4, Line 580:</a> <code style="font-family:monospace,monospace">    if (uptime_seconds < 0) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">This cannot happen with a monotonic clock? Unless you run for crazy amount of years without reboot w […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">True. My consideration was that there may be scheduling jitter between reading uptime and setting the last_uptime_read state. I forgot we're running in a single thread though and this will never happen. Removed.</p></li><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;">There's something here I'm not really following. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Yes, hopefully we always see very nearly zero downtime. :-) The last_uptime_read variable is also updated outside of this loop when a connection is reestablished. Let's say that happens half-way between calls to this timer loop. Now instead of seeing 10 seconds of elapsed uptime, we will only see 5 seconds of "new" uptime. This gives us 5 seconds which were interrupted in some way, signaling downtime.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Testing this locally by disrupting the BTS<->BSC connection results in seemingly accurate downtime numbers. It could perhaps be improved but I'm satisfied with the result so far. Suggestions welcome.</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: 4 </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 11:50:18 +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: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>