summary refs log tree commit diff
path: root/synapse/http/request_metrics.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-05-09 23:03:11 +0100
committerRichard van der Hoff <richard@matrix.org>2018-05-10 12:18:52 +0100
commit09b29f9c4a941ae5721b1f5e296156dfe92e3395 (patch)
tree2b10ca49d3a29c95d5c6473623b8c875eeeff73c /synapse/http/request_metrics.py
parentMove request_id management into SynapseRequest (diff)
downloadsynapse-09b29f9c4a941ae5721b1f5e296156dfe92e3395.tar.xz
Make RequestMetrics take a raw time rather than a clock
... which is going to make it easier to move around.
Diffstat (limited to '')
-rw-r--r--synapse/http/request_metrics.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/http/request_metrics.py b/synapse/http/request_metrics.py
index 4a843a36a7..4e8a5f5306 100644
--- a/synapse/http/request_metrics.py
+++ b/synapse/http/request_metrics.py
@@ -100,12 +100,12 @@ response_size = metrics.register_counter(
 
 
 class RequestMetrics(object):
-    def start(self, clock, name):
-        self.start = clock.time_msec()
+    def start(self, time_msec, name):
+        self.start = time_msec
         self.start_context = LoggingContext.current_context()
         self.name = name
 
-    def stop(self, clock, request):
+    def stop(self, time_msec, request):
         context = LoggingContext.current_context()
 
         tag = ""
@@ -122,7 +122,7 @@ class RequestMetrics(object):
         response_count.inc(request.method, self.name, tag)
 
         response_timer.inc_by(
-            clock.time_msec() - self.start, request.method,
+            time_msec - self.start, request.method,
             self.name, tag
         )