diff options
author | Erik Johnston <erik@matrix.org> | 2016-02-08 14:57:40 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-02-08 14:57:40 +0000 |
commit | cca5c0667966deabe814b512f320f1c058f0252b (patch) | |
tree | 4b4af8f645f62d4562417702ad7a6b7be2e9791b /synapse/http/server.py | |
parent | Merge pull request #563 from matrix-org/daniel/dollarz (diff) | |
parent | Add metrics to pushers (diff) | |
download | synapse-cca5c0667966deabe814b512f320f1c058f0252b.tar.xz |
Merge pull request #562 from matrix-org/erikj/push_metric
Add metrics to pushers
Diffstat (limited to 'synapse/http/server.py')
-rw-r--r-- | synapse/http/server.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py index c250a4604f..06935783ca 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -208,6 +208,9 @@ class JsonResource(HttpServer, resource.Resource): if request.method == "OPTIONS": self._send_response(request, 200, {}) return + + start_context = LoggingContext.current_context() + # Loop through all the registered callbacks to check if the method # and path regex match for path_entry in self.path_regexs.get(request.method, []): @@ -243,6 +246,13 @@ class JsonResource(HttpServer, resource.Resource): if context: tag = context.tag + if context != start_context: + logger.warn( + "Context have unexpectedly changed %r, %r", + context, self.start_context + ) + return + incoming_requests_counter.inc(request.method, servlet_classname, tag) response_timer.inc_by( |