<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">What exactly are you trying to achieve here? what is uptime?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I am considering uptime to mean the same as you've already defined it in the VTY output: the BSC and BTS have had a valid connection.</p><p style="white-space: pre-wrap; word-wrap: break-word;">But instead of delivering this information via the VTY, I want to export it via the statsd reporter. The ultimate goal is to be able to tell from the gathered statsd data: how many seconds of downtime did we experience in a given time interval.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Counting downtime is also a possibility but OsmoBSC already contained the concept of uptime so I've used it.</p><p style="white-space: pre-wrap; word-wrap: break-word;">This patch samples the change in uptime every X seconds and adds it to the uptime counter. This only needs to happen once per statsd reporter interval so a callback from that action might be better...or simply a way to know the current statsd reporter interval.</p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">In any case, none of the above is a rate counter.  Rate counters count the rate of events, such as the rate of BTS re-starts, the rate of channel allocations, etc.</p><p style="white-space: pre-wrap; word-wrap: break-word;">something like a stat_item might be better suited?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">I don't know enough about the stats system I guess to make that call. I just want to store the number of seconds of uptime per interval. Just as we count "channel activations per interval" I thought this was the way to go. Is a stat_item a more logical fit? I'll gladly refactor to use it if so.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Thanks,<br>-Michael</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/23234">View Change</a></p><ul style="list-style: none; padding: 0;"></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: 2 </div>
<div style="display:none"> Gerrit-Owner: iedemam <michael@kapsulate.com> </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-Comment-Date: Mon, 08 Mar 2021 11:51:02 +0000 </div>
<div style="display:none"> Gerrit-HasComments: No </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Gerrit-MessageType: comment </div>