in values if t <= stop+(step/2) and t >= start-(step/2)]) @bottle.route('/ping') def ping(): return 'pong' @bottle.route('/step') def get_step(): return json.dumps(interval) @bottle.route('/main') def main(): return main_html def parse_args(): parser = argparse.ArgumentParser(description="Plot CPU usage using cubism.js") parser.add_argument('-i', '--interval', help="interval between measurements in milliseconds (default: 500)", type=int, default='500') return parser.parse_args() if __name__ == '__main__': args = parse_args() interval = args.interval values = cpu_percent_thread(step=interval) schirmclient.wsgi_run(bottle.app(), url='/main')
import bottle import schirmclient @bottle.route('/hello/<name>') def index(name): return bottle.template('<b>Hello {{name}}</b>!', name=name) if __name__ == '__main__': schirmclient.wsgi_run(bottle.app(), url='/hello/schirm', fullscreen=True)
return 'pong' @bottle.route('/step') def get_step(): return json.dumps(interval) @bottle.route('/main') def main(): return main_html def parse_args(): parser = argparse.ArgumentParser( description="Plot CPU usage using cubism.js") parser.add_argument( '-i', '--interval', help="interval between measurements in milliseconds (default: 500)", type=int, default='500') return parser.parse_args() if __name__ == '__main__': args = parse_args() interval = args.interval values = cpu_percent_thread(step=interval) schirmclient.wsgi_run(bottle.app(), url='/main')