Skip to content

Commit 68068de

Browse files
Trace how much work is being done while "recursively fetching redactions" (#18854)
Spawning from observing this trace for a `/messages` request (`RoomMessageListRestServlet`). We don't know if it took a while for the database to fetch a single redaction or a whole chain of redactions.
1 parent 356cc4a commit 68068de

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

changelog.d/18854.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Trace how much work is being done while "recursively fetching redactions".

synapse/storage/databases/main/events_worker.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,13 +1338,18 @@ async def _get_events_from_db(
13381338
fetched_event_ids: Set[str] = set()
13391339
fetched_events: Dict[str, _EventRow] = {}
13401340

1341+
@trace
13411342
async def _fetch_event_ids_and_get_outstanding_redactions(
13421343
event_ids_to_fetch: Collection[str],
13431344
) -> Collection[str]:
13441345
"""
13451346
Fetch all of the given event_ids and return any associated redaction event_ids
13461347
that we still need to fetch in the next iteration.
13471348
"""
1349+
set_tag(
1350+
SynapseTags.FUNC_ARG_PREFIX + "event_ids_to_fetch.length",
1351+
str(len(event_ids_to_fetch)),
1352+
)
13481353
row_map = await self._enqueue_events(event_ids_to_fetch)
13491354

13501355
# we need to recursively fetch any redactions of those events

0 commit comments

Comments
 (0)