forked from MirrorHub/synapse
Fix federation inbound age metric. (#10355)
We should be reporting the age rather than absolute timestamp.
This commit is contained in:
parent
c2c364f27f
commit
879d8c1ee1
2 changed files with 4 additions and 1 deletions
1
changelog.d/10355.bugfix
Normal file
1
changelog.d/10355.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Fix newly added `synapse_federation_server_oldest_inbound_pdu_in_staging` prometheus metric to measure age rather than timestamp.
|
|
@ -1230,7 +1230,9 @@ class EventFederationWorkerStore(EventsWorkerStore, SignatureWorkerStore, SQLBas
|
|||
"SELECT coalesce(min(received_ts), 0) FROM federation_inbound_events_staging"
|
||||
)
|
||||
|
||||
(age,) = txn.fetchone()
|
||||
(received_ts,) = txn.fetchone()
|
||||
|
||||
age = self._clock.time_msec() - received_ts
|
||||
|
||||
return count, age
|
||||
|
||||
|
|
Loading…
Reference in a new issue