From a093fab253ca0e67d9ae861e5b8cf393ea7783f9 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 22 Aug 2016 10:18:12 +0100 Subject: Use top level measure --- synapse/http/server.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'synapse/http') diff --git a/synapse/http/server.py b/synapse/http/server.py index 2cba13e69f..d2efd9f3e4 100644 --- a/synapse/http/server.py +++ b/synapse/http/server.py @@ -222,7 +222,7 @@ class JsonResource(HttpServer, resource.Resource): # It does its own metric reporting because _async_render dispatches to # a callback and it's the class name of that callback we want to report # against rather than the JsonResource itself. - @request_handler(report_metrics=False) + @request_handler() @defer.inlineCallbacks def _async_render(self, request): """ This gets called from render() every time someone sends us a request. @@ -233,9 +233,6 @@ class JsonResource(HttpServer, resource.Resource): self._send_response(request, 200, {}) return - request_metrics = RequestMetrics() - request_metrics.start(self.clock) - # 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, []): @@ -249,12 +246,6 @@ class JsonResource(HttpServer, resource.Resource): callback = path_entry.callback - servlet_instance = getattr(callback, "__self__", None) - if servlet_instance is not None: - servlet_classname = servlet_instance.__class__.__name__ - else: - servlet_classname = "%r" % callback - kwargs = intern_dict({ name: urllib.unquote(value).decode("UTF-8") if value else value for name, value in m.groupdict().items() @@ -265,11 +256,6 @@ class JsonResource(HttpServer, resource.Resource): code, response = callback_return self._send_response(request, code, response) - try: - request_metrics.stop(self.clock, request, servlet_classname) - except: - pass - return # Huh. No one wanted to handle that? Fiiiiiine. Send 400. -- cgit 1.4.1