From: Florian Forster Date: Mon, 29 Jan 2024 13:15:24 +0000 (+0100) Subject: src/daemon/utils_cache.c: Add comment about initializing `ce->values_gauge` for non... X-Git-Tag: collectd-6.0.0.rc2~13^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4258%2Fhead;p=thirdparty%2Fcollectd.git src/daemon/utils_cache.c: Add comment about initializing `ce->values_gauge` for non-gauge types. --- diff --git a/src/daemon/utils_cache.c b/src/daemon/utils_cache.c index 0045464e1..ba4f1080d 100644 --- a/src/daemon/utils_cache.c +++ b/src/daemon/utils_cache.c @@ -151,6 +151,8 @@ static int uc_insert(metric_t const *m, char const *key) { switch (m->family->type) { case DS_TYPE_COUNTER: case DS_TYPE_DERIVE: + // Non-gauge types will store the rate in values_gauge when the second data + // point is available. Initially, NAN signifies "not enough data". ce->values_gauge = NAN; break;