<p>daniel has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11323">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stats_statsd: Send all stat_items as gauges<br><br>When sending a statsd metric we need to specify a type which can be a<br>"g"auge, "c"ounter, "t"imer, "h"istogram, and "m"eter.<br><br>We used to just pass the stat_item unit into this field, but that is the<br>unit of the metric (Seconds for a timer, % for utilization, ...).<br><br>Change the type field so stat_items are sent as "g"auges. Note that<br>negative values don't seem to be supported by statsd.<br><br>Change-Id: Ia16270d36c9a14521594de4b99a48c83e4ac07d4<br>---<br>M src/stats_statsd.c<br>1 file changed, 2 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/23/11323/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/stats_statsd.c b/src/stats_statsd.c</span><br><span>index 5ae2570..d3b139e 100644</span><br><span>--- a/src/stats_statsd.c</span><br><span>+++ b/src/stats_statsd.c</span><br><span>@@ -187,17 +187,16 @@</span><br><span>   const char *unit = desc->unit;</span><br><span> </span><br><span>        if (unit == OSMO_STAT_ITEM_NO_UNIT) {</span><br><span style="color: hsl(0, 100%, 40%);">-           unit = "g";</span><br><span>                if (value < 0)</span><br><span>                    osmo_stats_reporter_statsd_send(srep,</span><br><span>                                statg->desc->group_name_prefix,</span><br><span>                                statg->idx,</span><br><span style="color: hsl(0, 100%, 40%);">-                          desc->name, 0, unit);</span><br><span style="color: hsl(120, 100%, 40%);">+                              desc->name, 0, "g");</span><br><span>    }</span><br><span>    return osmo_stats_reporter_statsd_send(srep,</span><br><span>                 statg->desc->group_name_prefix,</span><br><span>                statg->idx,</span><br><span style="color: hsl(0, 100%, 40%);">-          desc->name, value, unit);</span><br><span style="color: hsl(120, 100%, 40%);">+          desc->name, value, "g");</span><br><span> }</span><br><span> #endif /* !EMBEDDED */</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11323">change 11323</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/11323"/><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-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia16270d36c9a14521594de4b99a48c83e4ac07d4 </div>
<div style="display:none"> Gerrit-Change-Number: 11323 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </div>