summaryrefslogtreecommitdiffstats
path: root/python.d
diff options
context:
space:
mode:
authorlgz <ilyamaschenko@gmail.com>2017-11-05 15:59:07 +0900
committerlgz <ilyamaschenko@gmail.com>2017-11-05 15:59:07 +0900
commit2ae2e351644e1d16c46df21cd0a40dd6063d61b4 (patch)
tree49bce8b5bd924c91135ad2d27a6068dd5059796d /python.d
parent2250b1de984741da7c48eae6e28615600dfc4da0 (diff)
move all charts stuff from SimpleService update() to chart update()
Diffstat (limited to 'python.d')
-rw-r--r--python.d/python_modules/bases/FrameworkServices/SimpleService.py4
-rw-r--r--python.d/python_modules/bases/charts.py9
2 files changed, 6 insertions, 7 deletions
diff --git a/python.d/python_modules/bases/FrameworkServices/SimpleService.py b/python.d/python_modules/bases/FrameworkServices/SimpleService.py
index 283a1980eb..acaee4911d 100644
--- a/python.d/python_modules/bases/FrameworkServices/SimpleService.py
+++ b/python.d/python_modules/bases/FrameworkServices/SimpleService.py
@@ -216,11 +216,7 @@ class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, objec
ok = chart.update(data, interval)
if ok:
- chart.penalty = 0
updated = True
- else:
- chart.flags.new = True
- chart.penalty += 1
if not updated:
self.debug('none of the charts has been updated')
diff --git a/python.d/python_modules/bases/charts.py b/python.d/python_modules/bases/charts.py
index db3b943e58..2dbef9e8da 100644
--- a/python.d/python_modules/bases/charts.py
+++ b/python.d/python_modules/bases/charts.py
@@ -202,7 +202,7 @@ class Chart:
chart = CHART_CREATE.format(**self.params)
dimensions = ''.join([dimension.create() for dimension in self.dimensions])
variables = ''.join([var.set(var.value) for var in self.variables if var])
- self.flags.new = False
+
self.flags.create = False
safe_print(chart + dimensions + variables)
@@ -228,7 +228,12 @@ class Chart:
chart_begin = CHART_BEGIN.format(type=self.type, id=self.id, since_last=since_last)
safe_print(chart_begin, updated_dimensions, updated_variables, 'END\n')
+
self.flags.new = False
+ self.penalty = 0
+ else:
+ self.penalty += 1
+ self.flags.new = True
return bool(updated_dimensions)
@@ -240,8 +245,6 @@ class Chart:
def refresh(self):
self.penalty = 0
self.flags.create = True
- if self.flags.obsoleted:
- self.flags.new = True
self.flags.obsoleted = False