From b5427b5a495dc9f66465d25ebdf1c608bdac563a Mon Sep 17 00:00:00 2001 From: Dominik Schloesser Date: Mon, 4 Sep 2017 13:54:26 +0200 Subject: review: CHRONY array moved out of service class. --- python.d/chrony.chart.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'python.d') 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): -- cgit v1.2.3