summaryrefslogtreecommitdiffstats
path: root/python.d
diff options
context:
space:
mode:
authorDominik Schloesser <dsc@dosc.net>2017-09-04 13:54:26 +0200
committerDominik Schloesser <dsc@dosc.net>2017-09-04 13:54:26 +0200
commitb5427b5a495dc9f66465d25ebdf1c608bdac563a (patch)
treeb167eaa2363967a45b9667d62d39ae6d13d22956 /python.d
parent24ba94c9f0b12c1adb523121f89ca865e087bde5 (diff)
review: CHRONY array moved out of service class.
Diffstat (limited to 'python.d')
-rw-r--r--python.d/chrony.chart.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/python.d/chrony.chart.py b/python.d/chrony.chart.py
index 70834bf2cf..9db1f8689f 100644
--- a/python.d/chrony.chart.py
+++ b/python.d/chrony.chart.py
@@ -61,6 +61,15 @@ CHARTS = {
]}
}
+CHRONY = [('Frequency', 'frequency', 1e3),
+ ('Last offset', 'lastoffset', 1e9),
+ ('RMS offset', 'rmsoffset', 1e9),
+ ('Residual freq', 'residualfreq', 1e3),
+ ('Root delay', 'rootdelay', 1e9),
+ ('Root dispersion', 'rootdispersion', 1e9),
+ ('Skew', 'skew', 1e3),
+ ('System time', 'timediff', 1e9)]
+
class Service(ExecutableService):
def __init__(self, configuration=None, name=None):
@@ -70,15 +79,6 @@ class Service(ExecutableService):
self.order = ORDER
self.definitions = CHARTS
- CHRONY = [('Frequency', 'frequency', 1e3),
- ('Last offset', 'lastoffset', 1e9),
- ('RMS offset', 'rmsoffset', 1e9),
- ('Residual freq', 'residualfreq', 1e3),
- ('Root delay', 'rootdelay', 1e9),
- ('Root dispersion', 'rootdispersion', 1e9),
- ('Skew', 'skew', 1e3),
- ('System time', 'timediff', 1e9)]
-
def _get_data(self):
"""
Format data received from shell command
@@ -99,7 +99,7 @@ class Service(ExecutableService):
if len(value) > 0:
parsed[key] = value.split()[0]
- for key, dim_id, multiplier in self.CHRONY:
+ for key, dim_id, multiplier in CHRONY:
try:
data[dim_id] = int(float(parsed[key]) * multiplier)
except (KeyError, ValueError):