From 5a0c4c79e72a1b5265c01a276136e0ea85d7e519 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Mon, 29 Jan 2024 14:15:24 +0100 Subject: [PATCH] src/daemon/utils_cache.c: Add comment about initializing `ce->values_gauge` for non-gauge types. --- src/daemon/utils_cache.c | 2 ++ 1 file changed, 2 insertions(+) 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; -- 2.47.2