summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7bab45b)
raw | patch | inline | side by side (parent: 7bab45b)
author | Pierre-Yves Ritschard <pyr@spootnik.org> | |
Mon, 19 Oct 2015 09:53:26 +0000 (11:53 +0200) | ||
committer | Pierre-Yves Ritschard <pyr@spootnik.org> | |
Mon, 19 Oct 2015 09:53:26 +0000 (11:53 +0200) |
When not using StoreRates false, this allows statsd aggregators
to hold on to the absolute count, if needed.
to hold on to the absolute count, if needed.
src/statsd.c | patch | blob | history |
diff --git a/src/statsd.c b/src/statsd.c
index 9a6da1d34fafafa49f2681149e5d7161176a613e..3ec1d9e938f4067f9a0ad9f37dc1104833cc4e43 100644 (file)
--- a/src/statsd.c
+++ b/src/statsd.c
else
values[0].gauge = (gauge_t) c_avl_size (metric->set);
}
- else
- values[0].derive = (derive_t) metric->value;
+ else { /* STATSD_COUNTER */
+ /*
+ * Expand a single value to two metrics:
+ *
+ * - The absolute counter, as a gauge
+ * - A derived rate for this counter
+ */
+ values[0].derive = (derive_t) metric->value;
+ plugin_dispatch_values(&vl);
+
+ sstrncpy(vl.type, "gauge", sizeof (vl.type));
+ values[0].gauge = (gauge_t) metric->value;
+ }
return (plugin_dispatch_values (&vl));
} /* }}} int statsd_metric_submit_unsafe */