scyllatop: PEP8 python coding style compliance
this patch fixes the following remarks: ./defaults.py:2:9: E126 continuation line over-indented for hanging indent ./fake.py:15:1: E305 expected 2 blank lines after class or function definition, found 1 ./livedata.py:49:17: F402 import 'metric' from line 5 shadowed by loop variable ./scyllatop.py:44:1: E305 expected 2 blank lines after class or function definition, found 1 Signed-off-by: Alexys Jacob <ultrabug@gentoo.org> Message-Id: <20180119162939.17866-1-ultrabug@gentoo.org>
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
DEFAULT_METRIC_PATTERNS = [
|
||||
'*cache*',
|
||||
'*disk*',
|
||||
'*transport*',
|
||||
'*netlink*',
|
||||
'*network*',
|
||||
'*storage_proxy*',
|
||||
'*la*',
|
||||
'*reactor*',
|
||||
'*idle*',
|
||||
'*interface*',
|
||||
'*memory*',
|
||||
'*cpu*',
|
||||
'*cache*',
|
||||
'*disk*',
|
||||
'*transport*',
|
||||
'*netlink*',
|
||||
'*network*',
|
||||
'*storage_proxy*',
|
||||
'*la*',
|
||||
'*reactor*',
|
||||
'*idle*',
|
||||
'*interface*',
|
||||
'*memory*',
|
||||
'*cpu*',
|
||||
]
|
||||
|
||||
@@ -12,6 +12,7 @@ class FakeCollectd(object):
|
||||
def query(self, command):
|
||||
pass
|
||||
|
||||
|
||||
Metric = metric.Metric
|
||||
if 'MARK_ABSENT_PROBABILITY' in os.environ:
|
||||
MARK_ABSENT_PROBABILITY = float(os.environ['MARK_ABSENT_PROBABILITY'])
|
||||
|
||||
@@ -46,19 +46,19 @@ class LiveData(object):
|
||||
|
||||
def go(self, mainLoop):
|
||||
while not self._stop:
|
||||
for metric in self._measurements:
|
||||
self._update(metric)
|
||||
for metric_obj in self._measurements:
|
||||
self._update(metric_obj)
|
||||
|
||||
for view in self._views:
|
||||
view.update(self)
|
||||
time.sleep(self._interval)
|
||||
mainLoop.draw_screen()
|
||||
|
||||
def _update(self, metric):
|
||||
def _update(self, metric_obj):
|
||||
try:
|
||||
metric.update()
|
||||
metric_obj.update()
|
||||
except parseexception.ParseException:
|
||||
logging.exception('exception while updating metric {0}'.format(metric))
|
||||
logging.exception('exception while updating metric {0}'.format(metric_obj))
|
||||
|
||||
def stop(self):
|
||||
self._stop = True
|
||||
|
||||
@@ -41,6 +41,7 @@ def fancyUserInterface(metricPatterns, interval, collectd):
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
description = '\n'.join(['A top-like tool for scylladb collectd metrics.',
|
||||
'Keyboard shortcuts: S - simple view, M - aggregate over multiple cores, Q -quits',
|
||||
|
||||
Reference in New Issue
Block a user