fix timing in python.d charts
paulfantom committed
Jun 12, 2016 at 11:55 UTC
f24aaa8a2594a89cae80c8d9124837daed283f81
1 file changed
+5
-3
plugins.d/python.d.plugin
+5
-3
@@ -24,7 +24,7 @@ class PythonCharts(object):
24
modules_configs='../conf.d/'):
25
self.first_run = True
26
self.interval = interval
27
- self.default_priority = 60000
27
+ self.default_priority = 90000
28
# check if plugin directory exists
29
if not os.path.isdir(modules_path):
30
debug("cannot find charts directory ", modules_path)
@@ -72,7 +72,6 @@ class PythonCharts(object):
72
73
# set priorities
74
for m in self.modules:
75
- print(m.priority)
75
try:
76
m.priority = int(m.priority)
77
except (AttributeError,ValueError):
@@ -189,7 +188,7 @@ class PythonCharts(object):
188
self.disable_module(mod, "misbehaving")
189
return
190
t2 = time.time()
192
- if self.first_run:
191
+ if not self.first_run:
192
dt = ""
193
else:
194
dt = int((t2 - self.timetable[mod.__name__][0]) * 1000000)
@@ -318,6 +317,9 @@ def run():
317
if out['interval'] is not None:
318
interval = out['interval']
319
320
+ # configure environement to run modules
321
+ #sys.path.append(modules_dir+"python_modules") # append path to directory with modules dependencies
322
+
323
# run plugins
324
charts = PythonCharts(interval, modules, modules_dir, modules_conf)
325
charts.check()