adding stats api call

pull/59/merge
jbruce 2022-05-21 10:29:18 -04:00
rodzic dcd722ad5f
commit 62c2d793aa
1 zmienionych plików z 7 dodań i 1 usunięć

Wyświetl plik

@ -13,7 +13,6 @@ from gevent.pywsgi import WSGIServer
from geventwebsocket.handler import WebSocketHandler
from geventwebsocket import WebSocketError
try:
sys.dont_write_bytecode = True
import config
@ -79,6 +78,13 @@ def handle_api():
log.info("api stop command received")
oven.abort_run()
# get stats during a run
if bottle.request.json['cmd'] == 'stats':
log.info("api stats command received")
if hasattr(oven,'pid'):
if hasattr(oven.pid,'pidstats'):
return json.dumps(oven.pid.pidstats)
return { "success" : True }
def find_profile(wanted):