summaryrefslogtreecommitdiffstats
path: root/python.d/cpufreq.chart.py
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
committerFederico Ceratto <federico.ceratto@gmail.com>2017-12-19 23:39:21 +0000
commit61aedf201c2c4bf0e5aa4db32e74f4d860b88593 (patch)
treebcf4f9a0cd8bc2daf38b2ff9f29bfcc1e5ed8968 /python.d/cpufreq.chart.py
parentNew upstream version 1.8.0+dfsg (diff)
downloadnetdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.tar.xz
netdata-61aedf201c2c4bf0e5aa4db32e74f4d860b88593.zip
New upstream version 1.9.0+dfsgupstream/1.9.0+dfsg
Diffstat (limited to '')
-rw-r--r--python.d/cpufreq.chart.py23
1 files changed, 5 insertions, 18 deletions
diff --git a/python.d/cpufreq.chart.py b/python.d/cpufreq.chart.py
index 01cc22b02..3abde736c 100644
--- a/python.d/cpufreq.chart.py
+++ b/python.d/cpufreq.chart.py
@@ -4,8 +4,8 @@
import glob
import os
-import time
-from base import SimpleService
+
+from bases.FrameworkServices.SimpleService import SimpleService
# default module values (can be overridden per job in `config`)
# update_every = 2
@@ -14,12 +14,13 @@ ORDER = ['cpufreq']
CHARTS = {
'cpufreq': {
- 'options': [None, 'CPU Clock', 'MHz', 'cpufreq', None, 'line'],
+ 'options': [None, 'CPU Clock', 'MHz', 'cpufreq', 'cpufreq.cpufreq', 'line'],
'lines': [
# lines are created dynamically in `check()` method
]}
}
+
class Service(SimpleService):
def __init__(self, configuration=None, name=None):
prefix = os.getenv('NETDATA_HOST_PREFIX', "")
@@ -29,7 +30,7 @@ class Service(SimpleService):
SimpleService.__init__(self, configuration=configuration, name=name)
self.order = ORDER
self.definitions = CHARTS
- self._orig_name = ""
+ self.fake_name = 'cpu'
self.assignment = {}
self.accurate_exists = True
self.accurate_last = {}
@@ -72,7 +73,6 @@ class Service(SimpleService):
if accurate_ok:
return data
-
for name, paths in self.assignment.items():
data[name] = open(paths['inaccurate'], 'r').read()
@@ -84,8 +84,6 @@ class Service(SimpleService):
except (KeyError, TypeError):
self.error("No path specified. Using: '" + self.sys_dir + "'")
- self._orig_name = self.chart_name
-
for path in glob.glob(self.sys_dir + '/system/cpu/cpu*/cpufreq/stats/time_in_state'):
path_elem = path.split('/')
cpu = path_elem[-4]
@@ -113,14 +111,3 @@ class Service(SimpleService):
return True
- def create(self):
- self.chart_name = "cpu"
- status = SimpleService.create(self)
- self.chart_name = self._orig_name
- return status
-
- def update(self, interval):
- self.chart_name = "cpu"
- status = SimpleService.update(self, interval=interval)
- self.chart_name = self._orig_name
- return status