]> arthur.barton.de Git - netdata.git/commitdiff
handling of debug interval
authorpaulfantom <paulfantom@gmail.com>
Sat, 18 Jun 2016 11:53:09 +0000 (13:53 +0200)
committerpaulfantom <paulfantom@gmail.com>
Sat, 18 Jun 2016 11:53:09 +0000 (13:53 +0200)
plugins.d/python.d.plugin
python.d/python_modules/base.py

index e7dfc5254c9733b9de1b8e3f40a9f3480661a13c..dd39cea5f20e71010d12ec47f90e4583f7cd35ef 100755 (executable)
@@ -45,6 +45,11 @@ class PythonCharts(object):
 
         # good economy and prosperity:
         self.jobs = self._create_jobs(configured_modules)
+        if DEBUG_FLAG:
+            if interval is None:
+                interval = 1
+            for job in self.jobs:
+                job._create_timetable(interval)
 
 
     def _create_jobs(self,modules):
index 05dc49c4edccc152d3b977609be1554643d1406d..9c1f76c3c995ca999105b3615f9dc4f4d4635ff4 100644 (file)
@@ -22,11 +22,13 @@ class BaseService(object):
         self.retries = int(config['retries'])
         self.retries_left = self.retries
 
-    def _create_timetable(self):
+    def _create_timetable(self,freq=None):
+        if freq is None:
+            freq = self.update_every
         now = time()
         self.timetable = {'last' : now,
-                          'next' : now - (now % self.update_every) + self.update_every,
-                          'freq' : self.update_every}
+                          'next' : now - (now % freq) + freq,
+                          'freq' : freq}
 
 
     def error(self, msg, exception=""):