daniel has uploaded this change for review. ( https://gerrit.osmocom.org/11323


Change subject: stats_statsd: Send all stat_items as gauges
......................................................................

stats_statsd: Send all stat_items as gauges

When sending a statsd metric we need to specify a type which can be a
"g"auge, "c"ounter, "t"imer, "h"istogram, and "m"eter.

We used to just pass the stat_item unit into this field, but that is the
unit of the metric (Seconds for a timer, % for utilization, ...).

Change the type field so stat_items are sent as "g"auges. Note that
negative values don't seem to be supported by statsd.

Change-Id: Ia16270d36c9a14521594de4b99a48c83e4ac07d4
---
M src/stats_statsd.c
1 file changed, 2 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/23/11323/1

diff --git a/src/stats_statsd.c b/src/stats_statsd.c
index 5ae2570..d3b139e 100644
--- a/src/stats_statsd.c
+++ b/src/stats_statsd.c
@@ -187,17 +187,16 @@
        const char *unit = desc->unit;

        if (unit == OSMO_STAT_ITEM_NO_UNIT) {
-               unit = "g";
                if (value < 0)
                        osmo_stats_reporter_statsd_send(srep,
                                statg->desc->group_name_prefix,
                                statg->idx,
-                               desc->name, 0, unit);
+                               desc->name, 0, "g");
        }
        return osmo_stats_reporter_statsd_send(srep,
                statg->desc->group_name_prefix,
                statg->idx,
-               desc->name, value, unit);
+               desc->name, value, "g");
 }
 #endif /* !EMBEDDED */


--
To view, visit https://gerrit.osmocom.org/11323
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia16270d36c9a14521594de4b99a48c83e4ac07d4
Gerrit-Change-Number: 11323
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillm...@sysmocom.de>

Reply via email to