summaryrefslogtreecommitdiffstats
path: root/python.d
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2017-09-10 14:53:45 -0700
committerSteven Noonan <steven@uplinklabs.net>2017-09-10 14:54:25 -0700
commitff379ef7cfe9969261efcba59cb6be9936f646ee (patch)
treec00cbf9d8e113fc8ea53e1a91ee9d2aa9952ae28 /python.d
parenta862c34ad543b483a4ae049fea4576b8df093b4d (diff)
cpuidle.chart.py: re-read schedstat after tickling idle CPUs
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Diffstat (limited to 'python.d')
-rw-r--r--python.d/cpuidle.chart.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/python.d/cpuidle.chart.py b/python.d/cpuidle.chart.py
index 3b404242f5..e5ed49bd2c 100644
--- a/python.d/cpuidle.chart.py
+++ b/python.d/cpuidle.chart.py
@@ -82,13 +82,17 @@ class Service(SimpleService):
delta = schedstat[cpu] - active_time
if delta < 1:
needs_tickle.append(cpu)
- self.last_schedstat = schedstat
if needs_tickle:
# This line is critical for the stats to update. If we don't "tickle"
# idle CPUs, then the counters for those CPUs stop counting.
self.__wake_cpus([int(cpu[3:]) for cpu in needs_tickle])
+ # Re-read schedstat now that we've tickled any idlers.
+ schedstat = self.__read_schedstat()
+
+ self.last_schedstat = schedstat
+
for cpu, metrics in self.assignment.items():
update_time = schedstat[cpu]
results[cpu + '_active_time'] = update_time