* cpufreq.chart.py PEP 8 code cleanups
Fixes formatting of nested container literals and two cases of using
len() to determine if a container is empty or not.
* python.d/apache.chart.py PEP 8 cleanup.
Makes quotes consistent for string literals and enforces preferred
formatting for container literals.
* python.d/beanstalk.chart.py PEP 8 cleanup
Fixes formatting of container literals.
* python.d/bind_rndc.chart.py PEP 8 cleanup
Fixed container literal formatting.
* python.d/ceph.chart.py PEP 8 cleanup
Fixed container literal formatting and line-continuation indentation.
* python.d/chrony.chart.py PEP 8 cleanups
Fixed container literal formatting and made string literals use
consistent quotes.
* python.d/cpuidle.chart.py PEP 8 cleanup
Fixed container literal formatting and made string literals use
consistent quotes.
The way I was tracking it before was bad because if we were too early or
late reading the time_in_state file, we might get really bogus results.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
It needs to fail one iteration so there's something to calculate deltas
against (the first iteration has no prior data). Once it has the first
pass, all future iterations will use the accurate mode data, if it's
available.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
If we switch the 'schedutil' cpufreq governor on, the 'time_in_state'
data becomes useless. And since cpufreq governors can be switched at any
time, we might as well make it possible to support transitioning between
governors without any bogus data appearing in our charts.
Before this commit, switching to 'schedutil' results in zeroed values,
and switching back to any other governor causes a huge spike datapoint
in the timeline.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
There were two major problems with this module:
- The 'cpuN' names weren't accurate. The 'self.paths.sort()' was trying
to compensate for os.walk() enumerating the CPUs out of order (as any
directory enumeration will do). Unfortunately the sort() function is
alphabetical, so it would result in a list of paths like this:
[
'/sys/.../cpu0/...'
'/sys/.../cpu1/...'
'/sys/.../cpu11/...'
'/sys/.../cpu12/...'
...
]
So the chart for cpu2 would actually map to cpu11's stats.
This can be corrected by extracting the 'cpuN' value that's already
inside the path anyway.
- The scaling_cur_freq value is an instantaneous value. It only
represents the current processor P-state at the time it was read, and
doesn't account for the other 999ms that netdata wasn't looking at the
value.
This can be corrected by using data from cpufreq_stats, which includes
P-state residency statistics. Note that the values in cpufreq_stats
aren't always valid (e.g. if the cpufreq governor is set to
'schedutil', the statistic files exist but are are empty), so we can
just fall back to the inaccurate scaling_cur_freq method if necessary.
Signed-off-by: Steven Noonan <steven@uplinklabs.net>