mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-10 01:46:51 +00:00
Merge pull request #3071 from matrix-org/erikj/resp_size_metrics
Add response size metrics
This commit is contained in:
commit
e8b03cab1b
1 changed files with 7 additions and 0 deletions
|
@ -87,6 +87,11 @@ response_db_sched_duration = metrics.register_counter(
|
||||||
"response_db_sched_duration_seconds", labels=["method", "servlet", "tag"]
|
"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
|
_next_request_id = 0
|
||||||
|
|
||||||
|
|
||||||
|
@ -400,6 +405,8 @@ class RequestMetrics(object):
|
||||||
context.db_sched_duration_ms / 1000., request.method, self.name, tag
|
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):
|
class RootRedirect(resource.Resource):
|
||||||
"""Redirects the root '/' path to another path."""
|
"""Redirects the root '/' path to another path."""
|
||||||
|
|
Loading…
Add table
Reference in a new issue