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

Fix federation inbound age metric. #10355

Merged
merged 2 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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