summary refs log tree commit diff
path: root/synapse/http/server.py
diff options
context:
space:
mode:
authorRichard van der Hoff <github@rvanderhoff.org.uk>2018-01-17 14:29:37 +0000
committerGitHub <noreply@github.com>2018-01-17 14:29:37 +0000
commita7e4ff9ccaad33c7a193fd2bf233260ada10f3e9 (patch)
tree0bb7d6f5f5bdeb7081e810bc119820b36b51d943 /synapse/http/server.py
parentMerge pull request #2797 from matrix-org/rav/user_id_checking (diff)
parentMerge remote-tracking branch 'origin/develop' into rav/track_db_scheduling (diff)
downloadsynapse-a7e4ff9ccaad33c7a193fd2bf233260ada10f3e9.tar.xz
Merge pull request #2795 from matrix-org/rav/track_db_scheduling
Track DB scheduling delay per-request
Diffstat (limited to 'synapse/http/server.py')
-rw-r--r--synapse/http/server.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index 9edb957ec2..165c684d0d 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -102,6 +102,10 @@ response_db_txn_duration = metrics.register_counter(
     ),
 )
 
+# seconds spent waiting for a db connection, when processing this request
+response_db_sched_duration = metrics.register_counter(
+    "response_db_sched_duration_seconds", labels=["method", "servlet", "tag"]
+)
 
 _next_request_id = 0
 
@@ -372,6 +376,9 @@ class RequestMetrics(object):
         response_db_txn_duration.inc_by(
             context.db_txn_duration_ms / 1000., request.method, self.name, tag
         )
+        response_db_sched_duration.inc_by(
+            context.db_sched_duration_ms / 1000., request.method, self.name, tag
+        )
 
 
 class RootRedirect(resource.Resource):