mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 11:16:07 -04:00
Add metrics to pushers
This commit is contained in:
parent
77c7ed0e93
commit
13e6262659
3 changed files with 149 additions and 31 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue