summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2018-07-24 10:43:30 +0100
committerGitHub <noreply@github.com>2018-07-24 10:43:30 +0100
commita6781450108f476c2c83d25a70e27f331e4c832e (patch)
tree2fbe0f15fe17c27664a6c4a7e0058e286bd6ed56 /synapse/storage
parentanother couple of logcontext leaks (diff)
parentMerge pull request #3555 from matrix-org/erikj/client_apis_move (diff)
downloadsynapse-a6781450108f476c2c83d25a70e27f331e4c832e.tar.xz
Merge branch 'develop' into rav/logcontext_fixes
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/events.py32
1 files changed, 21 insertions, 11 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index c06dbb3768..4d0706f23d 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -418,19 +418,29 @@ class EventsStore(EventsWorkerStore):
                             logger.info(
                                 "Calculating state delta for room %s", room_id,
                             )
-                            current_state = yield self._get_new_state_after_events(
-                                room_id,
-                                ev_ctx_rm,
-                                latest_event_ids,
-                                new_latest_event_ids,
-                            )
+
+                            with Measure(
+                                    self._clock,
+                                    "persist_events.get_new_state_after_events",
+                            ):
+                                current_state = yield self._get_new_state_after_events(
+                                    room_id,
+                                    ev_ctx_rm,
+                                    latest_event_ids,
+                                    new_latest_event_ids,
+                                )
+
                             if current_state is not None:
                                 current_state_for_room[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
+                                with Measure(
+                                        self._clock,
+                                        "persist_events.calculate_state_delta",
+                                ):
+                                    delta = yield self._calculate_state_delta(
+                                        room_id, current_state,
+                                    )
+                                    if delta is not None:
+                                        state_delta_for_room[room_id] = delta
 
                 yield self.runInteraction(
                     "persist_events",