summaryrefslogtreecommitdiffstats
path: root/python.d/cpufreq.chart.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:19:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-11-07 12:20:17 +0000
commita64a253794ac64cb40befee54db53bde17dd0d49 (patch)
treec1024acc5f6e508814b944d99f112259bb28b1be /python.d/cpufreq.chart.py
parentNew upstream version 1.10.0+dfsg (diff)
downloadnetdata-upstream/1.11.0+dfsg.tar.xz
netdata-upstream/1.11.0+dfsg.zip
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--collectors/python.d.plugin/cpufreq/cpufreq.chart.py (renamed from python.d/cpufreq.chart.py)12
1 files changed, 7 insertions, 5 deletions
diff --git a/python.d/cpufreq.chart.py b/collectors/python.d.plugin/cpufreq/cpufreq.chart.py
index 3abde736c..cbbab6d7f 100644
--- a/python.d/cpufreq.chart.py
+++ b/collectors/python.d.plugin/cpufreq/cpufreq.chart.py
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
# Description: cpufreq netdata python.d module
-# Author: Pawel Krupa (paulfantom) and Steven Noonan (tycho)
+# Author: Pawel Krupa (paulfantom)
+# Author: Steven Noonan (tycho)
+# SPDX-License-Identifier: GPL-3.0-or-later
import glob
import os
@@ -17,7 +19,8 @@ CHARTS = {
'options': [None, 'CPU Clock', 'MHz', 'cpufreq', 'cpufreq.cpufreq', 'line'],
'lines': [
# lines are created dynamically in `check()` method
- ]}
+ ]
+ }
}
@@ -92,7 +95,7 @@ class Service(SimpleService):
self.assignment[cpu]['accurate'] = path
self.accurate_last[cpu] = {}
- if len(self.assignment) == 0:
+ if not self.assignment:
self.accurate_exists = False
for path in glob.glob(self.sys_dir + '/system/cpu/cpu*/cpufreq/scaling_cur_freq'):
@@ -102,7 +105,7 @@ class Service(SimpleService):
self.assignment[cpu] = {}
self.assignment[cpu]['inaccurate'] = path
- if len(self.assignment) == 0:
+ if not self.assignment:
self.error("couldn't find a method to read cpufreq statistics")
return False
@@ -110,4 +113,3 @@ class Service(SimpleService):
self.definitions[ORDER[0]]['lines'].append([name, name, 'absolute', 1, 1000])
return True
-