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

Add some metrics for inbound and outbound federation processing times #7755

Merged
merged 5 commits into from
Jun 30, 2020

Conversation

erikjohnston
Copy link
Member

@erikjohnston erikjohnston commented Jun 29, 2020

These metrics measure:

  1. Time between event is persisted and it being queued up to be sent to the relevant remote servers, and
  2. Time taken to process an event from federation

This tracks the time between the event is persisted and it being sent to
destination servers (to remote homeservers or application servers).
@erikjohnston erikjohnston requested a review from a team June 29, 2020 16:04
synapse/metrics/__init__.py Outdated Show resolved Hide resolved
self._send_pdu(event, destinations)

now = self.clock.time_msec()
ts = await self.store.get_received_ts(event.event_id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any concern about how much latency this will add by hitting the database again?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, though I think in this case its a very simple query and will be dwarfed by the complexity of the get_hosts_in_room query above

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. 👍

@@ -0,0 +1 @@
Add some metrics for inbound and outbound federation latencies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth mentioning the metric names in case people want to use them?

Copy link
Member

@clokep clokep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems fine. I'm guessing this is to help figure out what part of the federation sender is going slow?

@erikjohnston
Copy link
Member Author

This seems fine. I'm guessing this is to help figure out what part of the federation sender is going slow?

And for some potential KPIs

@erikjohnston erikjohnston merged commit a996580 into develop Jun 30, 2020
@erikjohnston erikjohnston deleted the erikj/federation_metrics branch June 30, 2020 15:58
erikjohnston added a commit that referenced this pull request Jul 1, 2020
erikjohnston added a commit that referenced this pull request Jul 1, 2020
babolivier pushed a commit that referenced this pull request Sep 1, 2021
* commit 'dc80a0762':
  1.16.0rc1
  Back out MSC2625 implementation (#7761)
  Additional configuration options for auto-join rooms (#7763)
  Add some metrics for inbound and outbound federation processing times (#7755)
  Explain the purpose of the "tests" conditional dependency requirement (#7751)
  Add another yield point to state res v2 (#7746)
  Move flake8 to end. Don't exit script on failure (#7738)
  Make tox actions work on Debian 10 (#7703)
  Yield during large v2 state res. (#7735)
  add org.matrix.login.jwt so that m.login.jwt can be deprecated (#7675)
  Set Content-Length for Metrics requests (#7730)
  Sync ignored table names in synapse_port_db to current database schema (#7717)
  Allow local media to be marked as safe from being quarantined. (#7718)
  Convert directory handler to async/await (#7727)
  Speed up state res v2 across large state differences. (#7725)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants