@cryptotaxi247 / netdata-1 / commits / ff379ef7c

cpuidle.chart.py: re-read schedstat after tickling idle CPUs

Signed-off-by: Steven Noonan <steven@uplinklabs.net>

Steven Noonan committed Sep 10, 2017 at 14:53 UTC ff379ef7cfe9969261efcba59cb6be9936f646ee
1 file changed +5 -1
python.d/cpuidle.chart.py
+5 -1
@@ -82,13 +82,17 @@ class Service(SimpleService):
82 delta = schedstat[cpu] - active_time
83 if delta < 1:
84 needs_tickle.append(cpu)
85 - self.last_schedstat = schedstat
85
86 if needs_tickle:
87 # This line is critical for the stats to update. If we don't "tickle"
88 # idle CPUs, then the counters for those CPUs stop counting.
89 self.__wake_cpus([int(cpu[3:]) for cpu in needs_tickle])
90
91 + # Re-read schedstat now that we've tickled any idlers.
92 + schedstat = self.__read_schedstat()
93 +
94 + self.last_schedstat = schedstat
95 +
96 for cpu, metrics in self.assignment.items():
97 update_time = schedstat[cpu]
98 results[cpu + '_active_time'] = update_time