summary refs log tree commit diff
path: root/synapse/http
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-04-28 15:29:46 +0100
committerMark Haines <mark.haines@matrix.org>2016-04-28 15:29:46 +0100
commit351b50a887add49c5233a15e6d6a2e994b7d2e9b (patch)
tree956cb43366618cd566ee39c2d822fd134ee034a8 /synapse/http
parentFix typo in request metrics (diff)
downloadsynapse-351b50a887add49c5233a15e6d6a2e994b7d2e9b.tar.xz
Fix more typos in per-request metrics
Diffstat (limited to 'synapse/http')
-rw-r--r--synapse/http/server.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 35ec01678f..f705abab94 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -101,11 +101,12 @@ def wrap_request_handler(request_handler, report_metrics):
         global _next_request_id
         request_id = "%s-%s" % (request.method, _next_request_id)
         _next_request_id += 1
-        if report_metrics:
-            request_metrics = RequestMetrics()
-            request_metrics.start(self.clock)
 
         with LoggingContext(request_id) as request_context:
+            if report_metrics:
+                request_metrics = RequestMetrics()
+                request_metrics.start(self.clock)
+
             request_context.request = request_id
             with request.processing():
                 try:
@@ -307,7 +308,7 @@ class RequestMetrics(object):
         if context:
             tag = context.tag
 
-            if context != start_context:
+            if context != self.start_context:
                 logger.warn(
                     "Context have unexpectedly changed %r, %r",
                     context, self.start_context