<blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><p style="white-space: pre-wrap; word-wrap: break-word;">IIUC what's needed is an stat_item, a "struct timepsec start" storing the last date, and some time function setting the stat_item to timespecsub(now(),start). And setting start to {0,0} to set it to zero or keep last value or whatever. Am I missing something here?</p></blockquote><p style="white-space: pre-wrap; word-wrap: break-word;">The situation, that all channels are allocated, often fluctuates rapidly.<br>A channel is released, flag goes false. That last free channel is allocated again, flag goes true.</p><p style="white-space: pre-wrap; word-wrap: break-word;">In order to determine how much time exactly all channels were allocated, you can't just remember a point in time and report the difference.</p><p style="white-space: pre-wrap; word-wrap: break-word;">This code remembers when the flag went true and counts the time until it goes false.<br>Repeat that, and this code sums up those times where the flag was true.<br>Sounds like that is what you are trying to describe with the timespec start?</p><p><a href="https://gerrit.osmocom.org/c/osmo-bsc/+/25973">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/+/25973">change 25973</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/+/25973"/><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: Icdd36f27cb54b2e1b940c9e6404ba9dd3692a310 </div>
<div style="display:none"> Gerrit-Change-Number: 25973 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-CC: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 02 Nov 2021 16:29:11 +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>