move since_last check to chart update()
lgz committed
Nov 5, 2017 at 02:40 UTC
4fdb6bd9b99c1b8a828dc58f89e416b9ddb6f74d
3 files changed
+5
-4
python.d/beanstalk.chart.py
+2
-1
@@ -42,7 +42,8 @@ CHARTS = {
42
]
43
},
44
'connections_rate': {
45
- 'options': [None, 'Connections Rate', 'connections/s', 'server statistics', 'beanstalk.connections_rate', 'area'],
45
+ 'options': [None, 'Connections Rate', 'connections/s', 'server statistics', 'beanstalk.connections_rate',
46
+ 'area'],
47
'lines': [
48
['total-connections', 'connections', 'incremental']
49
]
python.d/python_modules/bases/FrameworkServices/SimpleService.py
+1
-2
@@ -215,8 +215,7 @@ class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, objec
215
self.error("chart '{0}' was removed due to non updating".format(chart.name))
216
continue
217
218
- since_last = 0 if chart.flags.new else interval
219
- ok = chart.update(data, since_last)
218
+ ok = chart.update(data, interval)
219
if ok:
220
chart.penalty = 0
221
updated = True
python.d/python_modules/bases/charts.py
+2
-1
@@ -207,7 +207,7 @@ class Chart:
207
208
safe_print(chart + dimensions + variables)
209
210
- def update(self, data, since_last):
210
+ def update(self, data, interval):
211
updated_dimensions, updated_variables = str(), str()
212
213
for dim in self.dimensions:
@@ -224,6 +224,7 @@ class Chart:
224
if self.flags.create:
225
self.create()
226
227
+ since_last = 0 if self.flags.new else interval
228
chart_begin = CHART_BEGIN.format(type=self.type, id=self.id, since_last=since_last)
229
safe_print(chart_begin, updated_dimensions, updated_variables, 'END\n')
230