def dumpToStdout(metricPatterns, interval, collectd, iterations): stdout = views.stdout.Stdout() liveData = livedata.LiveData(metricPatterns, interval, collectd) liveData.addView(stdout) loop = _FakeLoop(liveData, iterations) liveData.go(loop)
def main(screen, metricPatterns, interval, collectd): curses.curs_set(0) liveData = livedata.LiveData(metricPatterns, interval, collectd) simpleView = views.simple.Simple(screen) aggregateView = views.aggregate.Aggregate(screen) liveData.addView(simpleView) liveData.addView(aggregateView) aggregateView.onTop() userinput.UserInput(liveData, screen, simpleView, aggregateView) liveData.go()
def main(screen, metricPatterns, interval, collectd): curses.curs_set(0) liveData = livedata.LiveData(metricPatterns, interval, collectd) simpleView = views.simple.Simple(screen) meansView = views.means.Means(screen) liveData.addView(simpleView) liveData.addView(meansView) meansView.onTop() userinput.UserInput(liveData, screen, simpleView, meansView) liveData.go()
def main(metricPatterns, interval, collectd): aggregateView = views.aggregate.Aggregate() simpleView = views.simple.Simple() userInput = userinput.UserInput() loop = urwid.MainLoop(aggregateView.widget(), unhandled_input=userInput) userInput.setLoop(loop) userInput.setMap(M=aggregateView, S=simpleView) liveData = livedata.LiveData(metricPatterns, interval, collectd) liveData.addView(simpleView) liveData.addView(aggregateView) liveDataThread = threading.Thread(target=lambda: liveData.go(loop)) liveDataThread.daemon = True liveDataThread.start() loop.run()
def fancyUserInterface(metricPatterns, interval, metric_source): aggregateView = views.aggregate.Aggregate() simpleView = views.simple.Simple() userInput = userinput.UserInput() loop = urwid.MainLoop(aggregateView.widget(), unhandled_input=userInput) userInput.setLoop(loop) userInput.setMap(M=aggregateView, S=simpleView) liveData = livedata.LiveData(metricPatterns, interval, metric_source) liveData.addView(simpleView) liveData.addView(aggregateView) liveDataThread = threading.Thread(target=lambda: liveData.go(loop)) liveDataThread.daemon = True liveDataThread.start() try: loop.run() except KeyboardInterrupt: pass
def fancyUserInterface(metricPatterns, interval, metric_source, ttl): aggregateView = views.aggregate.Aggregate() simpleView = views.simple.Simple() userInput = userinput.UserInput() loop = urwid.MainLoop(aggregateView.widget(), unhandled_input=userInput) userInput.setLoop(loop) userInput.setMap(M=aggregateView, S=simpleView) try: liveData = livedata.LiveData(metricPatterns, interval, metric_source, ttl) except Exception as inst: print("scyllatop failed connecting to Scylla With an error: {error}".format(error=inst)) sys.exit(1) liveData.addView(simpleView) liveData.addView(aggregateView) liveDataThread = threading.Thread(target=lambda: liveData.go(loop)) liveDataThread.daemon = True liveDataThread.start() try: loop.run() except KeyboardInterrupt: pass