summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-06-30 16:58:06 +0100
committerGitHub <noreply@github.com>2020-06-30 16:58:06 +0100
commita99658074dc3b2b0f6abcb4f98d56bc1386398aa (patch)
tree108e1d5a12f2e3e1860aacad4b2790e80209882e /synapse/handlers
parentExplain the purpose of the "tests" conditional dependency requirement (#7751) (diff)
downloadsynapse-a99658074dc3b2b0f6abcb4f98d56bc1386398aa.tar.xz
Add some metrics for inbound and outbound federation processing times (#7755)
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/appservice.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py
index ac1b64caff..f7d9fd621e 100644
--- a/synapse/handlers/appservice.py
+++ b/synapse/handlers/appservice.py
@@ -114,6 +114,12 @@ class ApplicationServicesHandler(object):
                         for service in services:
                             self.scheduler.submit_event_for_as(service, event)
 
+                        now = self.clock.time_msec()
+                        ts = yield self.store.get_received_ts(event.event_id)
+                        synapse.metrics.event_processing_lag_by_event.labels(
+                            "appservice_sender"
+                        ).observe(now - ts)
+
                     @defer.inlineCallbacks
                     def handle_room_events(events):
                         for event in events: