summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d425636)
raw | patch | inline | side by side (parent: d425636)
author | Florian Forster <octo@collectd.org> | |
Mon, 31 Oct 2016 15:57:40 +0000 (16:57 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Mon, 31 Oct 2016 15:57:40 +0000 (16:57 +0100) |
src/daemon/utils_match.c | patch | blob | history |
index 31ee6df2935b5bfe936f46c0b9795062dae0a226..39f70433429cc54be8caca8df3d38294e1836a00 100644 (file)
--- a/src/daemon/utils_match.c
+++ b/src/daemon/utils_match.c
void match_value_reset (cu_match_value_t *mv)
{
- if ((mv == NULL)
- || ((mv->ds_type & UTILS_MATCH_DS_TYPE_GAUGE) == 0)
- || ((mv->ds_type & UTILS_MATCH_CF_GAUGE_PERSIST) != 0))
+ if (mv == NULL)
return;
- mv->value.gauge = NAN;
- mv->values_num = 0;
+ /* Reset GAUGE metrics only and except GAUGE_PERSIST. */
+ if ((mv->ds_type & UTILS_MATCH_DS_TYPE_GAUGE)
+ && !(mv->ds_type & UTILS_MATCH_CF_GAUGE_PERSIST))
+ {
+ mv->value.gauge = NAN;
+ mv->values_num = 0;
+ }
} /* }}} void match_value_reset */
void match_destroy (cu_match_t *obj)