Add metrics to pushers

This commit is contained in:
Erik Johnston 2016-02-04 10:15:56 +00:00
parent 77c7ed0e93
commit 13e6262659
3 changed files with 149 additions and 31 deletions

View file

@ -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(