summaryrefslogtreecommitdiffstats
path: root/python.d/python_modules/bases/FrameworkServices/SimpleService.py
diff options
context:
space:
mode:
Diffstat (limited to 'python.d/python_modules/bases/FrameworkServices/SimpleService.py')
-rw-r--r--python.d/python_modules/bases/FrameworkServices/SimpleService.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/python.d/python_modules/bases/FrameworkServices/SimpleService.py b/python.d/python_modules/bases/FrameworkServices/SimpleService.py
index 14c839101..177332c1f 100644
--- a/python.d/python_modules/bases/FrameworkServices/SimpleService.py
+++ b/python.d/python_modules/bases/FrameworkServices/SimpleService.py
@@ -33,6 +33,7 @@ class RuntimeCounters:
self.RETRIES = 0
self.RETRIES_MAX = configuration.pop('retries')
self.PENALTY = 0
+ self.RUNS = 1
def is_sleep_time(self):
return self.START_RUN < self.NEXT_RUN
@@ -82,6 +83,10 @@ class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, objec
return self.fake_name or self.name
@property
+ def runs_counter(self):
+ return self._runtime_counters.RUNS
+
+ @property
def update_every(self):
return self._runtime_counters.FREQ
@@ -178,6 +183,8 @@ class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, objec
self.error('update() unhandled exception: {error}'.format(error=error))
updated = False
+ job.RUNS += 1
+
if not updated:
if not self.manage_retries():
return
@@ -209,7 +216,10 @@ class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, objec
for chart in self.charts:
if chart.flags.obsoleted:
- continue
+ if chart.can_be_updated(data):
+ chart.refresh()
+ else:
+ continue
elif self.charts.cleanup and chart.penalty >= self.charts.cleanup:
chart.obsolete()
self.error("chart '{0}' was suppressed due to non updating".format(chart.name))