<p>osmith <strong>uploaded patch set #4</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/25206">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stats: send real last value if no new values come<br><br>Background:<br>* Individual values can be added to osmo_stat_item.values at any time.<br>* Stats are reported at a fixed interval (see vty 'stats interval'),<br>  e.g. every 10 seconds.<br>* In order to report a new stat value, we use the maximum of all<br>  osmo_stat_item.values added since the last report.<br>* By default, we do not send new stat values if they did not change<br>  (see vty 'config-stats' -> 'flush-period' default of 0).<br><br>Fix the following bug:<br>* If 'flush-period' is 0, and no new osmo_stat_item.values are coming<br>  in, the last value that gets reported is not necessarily the last<br>  entry in osmo_stat_item.values.<br>* For attached reporters (statsd), it could then be that the given stat<br>  stays at the wrong value for a long stretch of time (think of several<br>  hours/days/forever).<br><br>Explanation of how the test shows that it is fixed:<br>* stats get reported (value is irrelevant)<br>* osmo_stat_item gets a new value: 20<br>* osmo_stat_item gets a new value: 10<br>* stats get reported (value: 20, the maximum of both new values)<br>* osmo_stat_item gets no new values<br>* stats get reported (value: 10, this is new because of the bug fix,<br>  the real last value in osmo_stat_item, different from the 20 sent<br>  earlier, without the fix it would not send anything here and the last<br>  sent value would be 20)<br>* osmo_stat_item gets no new values<br>* stats get reported (nothing gets sent, since the real last value was<br>  already sent and 'flush-period' is 0)<br><br>Fixes: OS#5215<br>Change-Id: Ibeefd0e3d1dbe4be454ff05a21df4848b2abfabe<br>---<br>M TODO-RELEASE<br>M include/osmocom/core/stat_item.h<br>M src/stats.c<br>M tests/stats/stats_test.c<br>M tests/stats/stats_test.err<br>5 files changed, 15 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/06/25206/4</pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/25206">change 25206</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/libosmocore/+/25206"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ibeefd0e3d1dbe4be454ff05a21df4848b2abfabe </div>
<div style="display:none"> Gerrit-Change-Number: 25206 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@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: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>