Add performance handlers

This commit is contained in:
Matthias
2019-04-26 10:03:54 +02:00
parent 393e4ac90e
commit b1964851c9
2 changed files with 24 additions and 3 deletions

View File

@@ -113,6 +113,8 @@ class ApiServer(RPC):
app.add_url_rule('/count', 'count', view_func=self._count, methods=['GET'])
app.add_url_rule('/daily', 'daily', view_func=self._daily, methods=['GET'])
app.add_url_rule('/profit', 'profit', view_func=self._profit, methods=['GET'])
app.add_url_rule('/performance', 'performance', view_func=self._performance,
methods=['GET'])
app.add_url_rule('/status', 'status', view_func=self._status, methods=['GET'])
app.add_url_rule('/version', 'version', view_func=self._version, methods=['GET'])
@@ -122,10 +124,8 @@ class ApiServer(RPC):
app.add_url_rule('/whitelist', 'whitelist', view_func=self._whitelist,
methods=['GET'])
# TODO: Implement the following
# performance
# forcebuy
# forcesell
# blacklist params
# edge
# help (?)
@@ -266,6 +266,20 @@ class ApiServer(RPC):
return self.rest_dump(stats)
@safe_rpc
def _performance(self):
"""
Handler for /performance.
Returns a cumulative performance statistics
:return: stats
"""
logger.info("LocalRPC - performance Command Called")
stats = self._rpc_performance()
return self.rest_dump(stats)
@safe_rpc
def _status(self):
"""