]> git.ipfire.org Git - telemetry.git/commitdiff
graphs: processor: Use NaN-safe addition
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 18 Mar 2026 15:03:17 +0000 (15:03 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 18 Mar 2026 15:03:17 +0000 (15:03 +0000)
This is needed so that we can import incomplete data from collectd where
guest and guest_nice don't exist. We will just treat those values as
zero.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/daemon/graphs/processor.c

index 74f90796f3dee87f6ab631b88f6905224d2aa981..8eb0d918200a24fb0e24444301962adbff43a7b6 100644 (file)
@@ -40,7 +40,8 @@ static int processor_render(td_ctx* ctx, td_graph* graph,
 
        // Add up all used cycles
        r = td_args_push(args,
-               "CDEF:usage=user,nice,+,sys,+,wait,+,irq,+,softirq,+,steal,+,guest,+,guest_nice,+");
+               "CDEF:usage=user,nice,ADDNAN,sys,ADDNAN,wait,ADDNAN,irq,ADDNAN,"
+               "softirq,ADDNAN,steal,ADDNAN,guest,ADDNAN,guest_nice,ADDNAN");
        if (r < 0)
                return r;