NOTE: scyllatop now requires the urwid library previously, if there were more metrics that lines in the terminal window, the user could not see some of the metrics. Now the user can scroll. As an added bonus, the program will not crash when the window size changes. Signed-off-by: Yoav Kleinberger <yoav@scylladb.com> Message-Id: <1464098832-5755-1-git-send-email-yoav@scylladb.com>
20 lines
544 B
Python
20 lines
544 B
Python
import base
|
|
import helpers
|
|
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
|