Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add response size metrics #3071

Merged
merged 1 commit into from
Apr 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions synapse/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@
"response_db_sched_duration_seconds", labels=["method", "servlet", "tag"]
)

# size in bytes of the response written
response_size = metrics.register_counter(
"response_size", labels=["method", "servlet", "tag"]
)

_next_request_id = 0


Expand Down Expand Up @@ -400,6 +405,8 @@ def stop(self, clock, request):
context.db_sched_duration_ms / 1000., request.method, self.name, tag
)

response_size.inc_by(request.sentLength, request.method, self.name, tag)


class RootRedirect(resource.Resource):
"""Redirects the root '/' path to another path."""
Expand Down