summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/cpufreq/cpufreq.chart.py
diff options
context:
space:
mode:
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
-