diff options
author | Eric Eastwood <erice@element.io> | 2022-08-03 10:57:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-03 10:57:38 -0500 |
commit | 92d21faf12c982a8d27ad465eb94f2fed0e8b32f (patch) | |
tree | 92575050ec2751e404df3328020ad73eeb1c3d81 /synapse/storage/controllers | |
parent | Return 404 or member list when getting joined_members after leaving (#13374) (diff) | |
download | synapse-92d21faf12c982a8d27ad465eb94f2fed0e8b32f.tar.xz |
Instrument `/messages` for understandable traces in Jaeger (#13368)
In Jaeger: - Before: huge list of uncategorized database calls - After: nice and collapsible into units of work
Diffstat (limited to 'synapse/storage/controllers')
-rw-r--r-- | synapse/storage/controllers/state.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/storage/controllers/state.py b/synapse/storage/controllers/state.py index 1e35046e07..0d480f1014 100644 --- a/synapse/storage/controllers/state.py +++ b/synapse/storage/controllers/state.py @@ -29,6 +29,7 @@ from typing import ( from synapse.api.constants import EventTypes from synapse.events import EventBase +from synapse.logging.opentracing import trace from synapse.storage.state import StateFilter from synapse.storage.util.partial_state_events_tracker import ( PartialCurrentStateTracker, @@ -179,6 +180,7 @@ class StateStorageController: return self.stores.state._get_state_groups_from_groups(groups, state_filter) + @trace async def get_state_for_events( self, event_ids: Collection[str], state_filter: Optional[StateFilter] = None ) -> Dict[str, StateMap[EventBase]]: @@ -225,6 +227,7 @@ class StateStorageController: return {event: event_to_state[event] for event in event_ids} + @trace async def get_state_ids_for_events( self, event_ids: Collection[str], @@ -287,6 +290,7 @@ class StateStorageController: ) return state_map[event_id] + @trace async def get_state_ids_for_event( self, event_id: str, state_filter: Optional[StateFilter] = None ) -> StateMap[str]: @@ -327,6 +331,7 @@ class StateStorageController: groups, state_filter or StateFilter.all() ) + @trace async def get_state_group_for_events( self, event_ids: Collection[str], |