summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f73bf70)
raw | patch | inline | side by side (parent: f73bf70)
author | Florian Forster <octo@collectd.org> | |
Tue, 2 Dec 2014 10:22:13 +0000 (11:22 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Tue, 2 Dec 2014 10:22:13 +0000 (11:22 +0100) |
This fixes the !ByState && ByCpu case, i.e. when the user requests one
metric ("active") per CPU.
Bug: #820
metric ("active") per CPU.
Bug: #820
src/cpu.c | patch | blob | history |
diff --git a/src/cpu.c b/src/cpu.c
index 9d812c803bb1505a20e295d42c0ad3760426c8db..8d9c0a6f06388c77b807bd12b5ccf0d81a7e856e 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
RATE_ADD (this_cpu_states[COLLECTD_CPU_STATE_ACTIVE].rate, this_cpu_states[state].rate);
}
+ if (!isnan (this_cpu_states[COLLECTD_CPU_STATE_ACTIVE].rate))
+ this_cpu_states[COLLECTD_CPU_STATE_ACTIVE].has_value = 1;
+
RATE_ADD (sum_by_state[COLLECTD_CPU_STATE_ACTIVE], this_cpu_states[COLLECTD_CPU_STATE_ACTIVE].rate);
}
} /* }}} void aggregate */
};
size_t state;
- for (state = 0; state < COLLECTD_CPU_STATE_ACTIVE; state++)
+ for (state = 0; state < COLLECTD_CPU_STATE_MAX; state++)
if (this_cpu_states[state].has_value)
local_rates[state] = this_cpu_states[state].rate;