summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-04-11 11:52:19 +0100
committerErik Johnston <erik@matrix.org>2018-04-11 14:27:09 +0100
commit4dae4a97ed0e0b2cc9b5493172670ec7353ded2e (patch)
treec9cba610b5cd4985b46d50fd4fd8197179d48790 /synapse/handlers
parentTrack where event stream processing have gotten up to (diff)
downloadsynapse-4dae4a97ed0e0b2cc9b5493172670ec7353ded2e.tar.xz
Track last processed event received_ts
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/appservice.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py
index 2a7e31e711..fcc1246bee 100644
--- a/synapse/handlers/appservice.py
+++ b/synapse/handlers/appservice.py
@@ -115,6 +115,16 @@ class ApplicationServicesHandler(object):
                     synapse.metrics.event_processing_positions.set(
                         upper_bound, "appservice_sender",
                     )
+
+                    now = self.clock.time_msec()
+                    ts = yield self.store.get_received_ts(events[-1].event_id)
+
+                    synapse.metrics.event_processing_lag.set(
+                        now - ts, "appservice_sender",
+                    )
+                    synapse.metrics.event_processing_last_ts.set(
+                        ts, "appservice_sender",
+                    )
             finally:
                 self.is_processing = False