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

Commit

Permalink
Trace how many new events from the backfill response we need to proce…
Browse files Browse the repository at this point in the history
…ss (#15633)

You can kinda derive this information from how many `_process_pulled_event` spans there are but it would be nice to quickly glance.
  • Loading branch information
MadLittleMods committed May 19, 2023
1 parent 736199b commit ca3c07e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions changelog.d/15633.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Trace how many new events from the backfill response we need to process.
5 changes: 5 additions & 0 deletions synapse/handlers/federation_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,11 @@ async def _process_pulled_events(
# Continue on with the events that are new to us.
new_events.append(event)

set_tag(
SynapseTags.RESULT_PREFIX + "new_events.length",
str(len(new_events)),
)

# We want to sort these by depth so we process them and
# tell clients about them in order.
sorted_events = sorted(new_events, key=lambda x: x.depth)
Expand Down

0 comments on commit ca3c07e

Please sign in to comment.