Merge pull request #3590 from matrix-org/rav/persist_events_metrics

Add some measure blocks to persist_events
This commit is contained in:
Richard van der Hoff 2018-07-24 10:41:51 +01:00 committed by GitHub
commit 2601ee28bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 11 deletions

1
changelog.d/3590.misc Normal file
View File

@ -0,0 +1 @@
Add some measure blocks to persist_events

View File

@ -417,14 +417,24 @@ class EventsStore(EventsWorkerStore):
logger.info( logger.info(
"Calculating state delta for room %s", room_id, "Calculating state delta for room %s", room_id,
) )
with Measure(
self._clock,
"persist_events.get_new_state_after_events",
):
current_state = yield self._get_new_state_after_events( current_state = yield self._get_new_state_after_events(
room_id, room_id,
ev_ctx_rm, ev_ctx_rm,
latest_event_ids, latest_event_ids,
new_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
with Measure(
self._clock,
"persist_events.calculate_state_delta",
):
delta = yield self._calculate_state_delta( delta = yield self._calculate_state_delta(
room_id, current_state, room_id, current_state,
) )