@cryptotaxi247 / netdata-1 / commits / 051524af2

uppercase chart flags

lgz committed Nov 4, 2017 at 16:44 UTC 051524af2df5f5d93c4f55734ae3997a9b4922e8
3 files changed +15 -15
python.d/beanstalk.chart.py
+1 -1
@@ -145,7 +145,7 @@ def tube_chart_template(name):
145 ['_'.join([name, 'current-watching']), 'watching']
146 ]},
147 order[3]: {
148 - 'options': [None, 'Commands', 'command/s', family, 'beanstalk.commands', 'stacked'],
148 + 'options': [None, 'Commands', 'commands/s', family, 'beanstalk.commands', 'stacked'],
149 'lines': [
150 ['_'.join([name, 'cmd-delete']), 'deletes', 'incremental'],
151 ['_'.join([name, 'cmd-pause-tube']), 'pauses', 'incremental']
python.d/python_modules/bases/FrameworkServices/SimpleService.py
+2 -2
@@ -208,14 +208,14 @@ class SimpleService(Thread, PythonDLimitedLogger, OldVersionCompatibility, objec
208
209 for chart in self.charts:
210
211 - if chart.flags.obsolete:
211 + if chart.flags.OBSOLETE:
212 continue
213 elif chart.cleanup and chart.penalty > chart.cleanup:
214 chart.push_obsolete()
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
218 + since_last = 0 if chart.flags.NEW else interval
219 ok = chart.update(data, since_last)
220 if ok:
221 updated = True
python.d/python_modules/bases/charts.py
+12 -12
@@ -131,7 +131,7 @@ class Charts:
131 return new_chart
132
133 def active_charts(self):
134 - return [chart.id for chart in self if not chart.flags.obsolete]
134 + return [chart.id for chart in self if not chart.flags.OBSOLETE]
135
136
137 class Chart:
@@ -207,7 +207,7 @@ class Chart:
207 return chart + dimensions + variables
208
209 def push_obsolete(self):
210 - self.flags.obsolete = True
210 + self.flags.OBSOLETE = True
211 safe_print(CHART_OBSOLETE.format(**self.params))
212
213 def update(self, data, since_last):
@@ -230,7 +230,7 @@ class Chart:
230 updated_variables += var.set(value)
231
232 if updated_dimensions:
233 - if self.flags.push:
233 + if self.flags.PUSH:
234 self.push_created()
235
236 chart_begin = CHART_BEGIN.format(type=self.type, id=self.id, since_last=since_last)
@@ -242,8 +242,8 @@ class Chart:
242
243 def push_created(self):
244 self.penalty = 0
245 - self.flags.push = False
246 - self.flags.new = False
245 + self.flags.PUSH = False
246 + self.flags.NEW = False
247 safe_print(self.create())
248
249 @staticmethod
@@ -252,10 +252,10 @@ class Chart:
252
253 def refresh(self):
254 self.penalty = 0
255 - self.flags.push = True
256 - if self.flags.obsolete:
257 - self.flags.new = True
258 - self.flags.obsolete = False
255 + self.flags.PUSH = True
256 + if self.flags.OBSOLETE:
257 + self.flags.NEW = True
258 + self.flags.OBSOLETE = False
259
260
261 class Dimension:
@@ -353,6 +353,6 @@ class ChartVariable:
353
354 class ChartFlags:
355 def __init__(self):
356 - self.new = True
357 - self.obsolete = False
358 - self.push = True
356 + self.NEW = True
357 + self.OBSOLETE = False
358 + self.PUSH = True