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:
Alexys Jacob
2018-01-19 17:29:39 +01:00
committed by Avi Kivity
parent 604bc40d8a
commit bd3517efd8
4 changed files with 19 additions and 17 deletions

View File

@@ -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*',
]

View File

@@ -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'])

View File

@@ -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

View File

@@ -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',