Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix federation inbound age metric. (#10355)
Browse files Browse the repository at this point in the history
We should be reporting the age rather than absolute timestamp.
  • Loading branch information
erikjohnston authored Jul 13, 2021
1 parent c2c364f commit 879d8c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/10355.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix newly added `synapse_federation_server_oldest_inbound_pdu_in_staging` prometheus metric to measure age rather than timestamp.
4 changes: 3 additions & 1 deletion synapse/storage/databases/main/event_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,9 @@ def _get_stats_for_federation_staging_txn(txn):
"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

Expand Down

0 comments on commit 879d8c1

Please sign in to comment.