Files
scylladb/tools/scyllatop/userinput.py
Yoav Kleinberger 91269d0c15 tools/scyllatop: add sums to aggregate view
the aggregate view now supports both sums and means.

Signed-off-by: Yoav Kleinberger <yoav@scylladb.com>
Message-Id: <1328af8efb113a786d7402b0704220108bfb28db.1458749600.git.yoav@scylladb.com>
2016-03-23 18:49:57 +02:00

27 lines
832 B
Python

import threading
import logging
class UserInput(threading.Thread):
def __init__(self, liveData, screen, simpleView, aggregateView):
self._liveData = liveData
self._screen = screen
self._simpleView = simpleView
self._aggregateView = aggregateView
threading.Thread.__init__(self)
self.daemon = True
self.start()
def run(self):
while True:
keypress = self._screen.getch()
logging.debug('key pressed {0}'.format(keypress))
if keypress == ord('m'):
self._aggregateView.onTop()
if keypress == ord('s'):
self._simpleView.onTop()
if keypress == ord('q'):
logging.info('quitting on user request')
self._liveData.stop()
return