summary refs log tree commit diff
path: root/synapse/federation
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/federation
parentTrack where event stream processing have gotten up to (diff)
downloadsynapse-4dae4a97ed0e0b2cc9b5493172670ec7353ded2e.tar.xz
Track last processed event received_ts
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/transaction_queue.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/federation/transaction_queue.py b/synapse/federation/transaction_queue.py
index d68f0d8950..1c466cbded 100644
--- a/synapse/federation/transaction_queue.py
+++ b/synapse/federation/transaction_queue.py
@@ -243,6 +243,17 @@ class TransactionQueue(object):
                     next_token, "federation_sender",
                 )
 
+                if events:
+                    now = self.clock.time_msec()
+                    ts = yield self.store.get_received_ts(events[-1].event_id)
+
+                    synapse.metrics.event_processing_lag.set(
+                        now - ts, "federation_sender",
+                    )
+                    synapse.metrics.event_processing_last_ts.set(
+                        ts, "federation_sender",
+                    )
+
         finally:
             self._is_processing = False