Files
scylladb/tools/scyllatop/views/simple.py
Avi Kivity 8e9989685d scyllatop: complete conversion to python3
d2dbbba139 converted scyllatop's interperter to Python 3, but neglected to do
the actual conversion. This patch does so, by running 2to3 over allfiles and adding
an additional bytes->string decode step in prometheus.py. Superfluous 2to3 changes
to print() calls were removed.
Message-Id: <20190117124121.7409-1-avi@scylladb.com>
2019-01-17 12:50:25 +00:00

20 lines
565 B
Python

from . import base
from . import helpers
from . import table
class Simple(base.Base):
def update(self, liveData):
self.clearScreen()
self.writeStatusLine(liveData.measurements)
tableForm = self._prepareTable(liveData.measurements)
for row in tableForm.rows():
self.writeLine(row)
self.refresh()
def _prepareTable(self, measurements):
result = table.Table('lr')
for metric in measurements:
result.add(metric.symbol, helpers.formatValues(metric.status))
return result