mirror of
https://github.com/scylladb/scylladb.git
synced 2026-06-03 05:26:58 +00:00
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>
27 lines
832 B
Python
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
|