From: Florian Forster Date: Wed, 27 Sep 2017 09:08:50 +0000 (+0200) Subject: src/utils_match.c: Reset UTILS_MATCH_CF_GAUGE_INC matches to zero (was: NaN) X-Git-Tag: collectd-5.8.0~73^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=11a94dba68c7797fc3c4bc45f249447b4243e082;p=collectd.git src/utils_match.c: Reset UTILS_MATCH_CF_GAUGE_INC matches to zero (was: NaN) Fixes: #2448 --- diff --git a/src/utils_match.c b/src/utils_match.c index df70fbec..d3edb57c 100644 --- a/src/utils_match.c +++ b/src/utils_match.c @@ -294,7 +294,7 @@ void match_value_reset(cu_match_value_t *mv) { /* 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->value.gauge = (mv->ds_type & UTILS_MATCH_CF_GAUGE_INC) ? 0 : NAN; mv->values_num = 0; } } /* }}} void match_value_reset */