Commit c1b171ee authored by Daniele Venzano's avatar Daniele Venzano

For now metrics are recorded only for the Master API, on the master side.

parent b452d681
......@@ -34,10 +34,10 @@ class BaseMetricSender(threading.Thread):
def _time_diff_ms(self, start: float, end: float) -> int:
return (end - start) * 1000
def metric_api_call(self, time_start, api_name, action, calling_user):
def metric_api_call(self, time_start, action):
time_end = time.time()
td = self._time_diff_ms(time_start, time_end)
log.debug("api latency: {} {} user {} took {} ms".format(api_name, action, calling_user.name, td))
log.debug("api latency: {} took {} ms".format(action, td))
def run(self):
pass
......@@ -67,10 +67,10 @@ class InfluxDBMetricSender(zoe_lib.metrics.base.BaseMetricSender):
self._queue.put(point_str)
def metric_api_call(self, time_start, api_name, action, calling_user):
def metric_api_call(self, time_start, action):
time_end = time.time()
td = self._time_diff_ms(time_start, time_end)
self.point("api_latency", td, api_name=api_name, action=action, calling_user_name=calling_user.name)
self.point("api_latency", td, api_call=action)
def run(self):
log.info('starting influxdb metric sender thread')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment