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

Commit

Permalink
Merge pull request #3071 from matrix-org/erikj/resp_size_metrics
Browse files Browse the repository at this point in the history
Add response size metrics
  • Loading branch information
erikjohnston authored Apr 6, 2018
2 parents 8844f95 + 7b824f1 commit e8b03ca
Showing 1 changed file with 7 additions and 0 deletions.
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

0 comments on commit e8b03ca

Please sign in to comment.