diff options
author | Eric Eastwood <erice@element.io> | 2023-05-19 12:26:58 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-19 12:26:58 -0500 |
commit | 703a8f9c67cfe25b956dfdcca654818d52fa7ebd (patch) | |
tree | b2d15c474c2020c0541083cc20e33344fefe1e7f /synapse/events/snapshot.py | |
parent | Trace how many new events from the backfill response we need to process (#15633) (diff) | |
download | synapse-703a8f9c67cfe25b956dfdcca654818d52fa7ebd.tar.xz |
Instrument `state` and `state_group` storage related things (tracing) (#15610)
Instrument `state` and `state_group` storage related things (tracing) so it's a little more clear where these database transactions are coming from as there is a lot of wires crossing in these functions. Part of `/messages` performance investigation: https://github.com/matrix-org/synapse/issues/13356
Diffstat (limited to 'synapse/events/snapshot.py')
-rw-r--r-- | synapse/events/snapshot.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/events/snapshot.py b/synapse/events/snapshot.py index 9b4d692cf4..e7e8225b8e 100644 --- a/synapse/events/snapshot.py +++ b/synapse/events/snapshot.py @@ -19,6 +19,7 @@ from immutabledict import immutabledict from synapse.appservice import ApplicationService from synapse.events import EventBase +from synapse.logging.opentracing import tag_args, trace from synapse.types import JsonDict, StateMap if TYPE_CHECKING: @@ -242,6 +243,8 @@ class EventContext(UnpersistedEventContextBase): return self._state_group + @trace + @tag_args async def get_current_state_ids( self, state_filter: Optional["StateFilter"] = None ) -> Optional[StateMap[str]]: @@ -275,6 +278,8 @@ class EventContext(UnpersistedEventContextBase): return prev_state_ids + @trace + @tag_args async def get_prev_state_ids( self, state_filter: Optional["StateFilter"] = None ) -> StateMap[str]: |