mirror of
https://github.com/element-hq/synapse
synced 2024-08-18 19:10:52 +00:00
Add some measure blocks to persist_events
... to help us figure out where 40% of CPU is going
This commit is contained in:
parent
f559119de0
commit
1938cffaea
1 changed files with 15 additions and 11 deletions
|
@ -417,19 +417,23 @@ class EventsStore(EventsWorkerStore):
|
||||||
logger.info(
|
logger.info(
|
||||||
"Calculating state delta for room %s", room_id,
|
"Calculating state delta for room %s", room_id,
|
||||||
)
|
)
|
||||||
current_state = yield self._get_new_state_after_events(
|
|
||||||
room_id,
|
with Measure("persist_events.get_new_state_after_events"):
|
||||||
ev_ctx_rm,
|
current_state = yield self._get_new_state_after_events(
|
||||||
latest_event_ids,
|
room_id,
|
||||||
new_latest_event_ids,
|
ev_ctx_rm,
|
||||||
)
|
latest_event_ids,
|
||||||
|
new_latest_event_ids,
|
||||||
|
)
|
||||||
|
|
||||||
if current_state is not None:
|
if current_state is not None:
|
||||||
current_state_for_room[room_id] = current_state
|
current_state_for_room[room_id] = current_state
|
||||||
delta = yield self._calculate_state_delta(
|
with Measure("persist_events.calculate_state_delta"):
|
||||||
room_id, current_state,
|
delta = yield self._calculate_state_delta(
|
||||||
)
|
room_id, current_state,
|
||||||
if delta is not None:
|
)
|
||||||
state_delta_for_room[room_id] = delta
|
if delta is not None:
|
||||||
|
state_delta_for_room[room_id] = delta
|
||||||
|
|
||||||
yield self.runInteraction(
|
yield self.runInteraction(
|
||||||
"persist_events",
|
"persist_events",
|
||||||
|
|
Loading…
Reference in a new issue