summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-05-31 12:01:38 +0100
committerErik Johnston <erik@matrix.org>2016-05-31 12:01:38 +0100
commitd375e0038e74ca29da4a1bb9bd56797326357cf0 (patch)
tree6b428a58f7cb2a505a4cf9634176d27fbcb5cfca
parentAdd some crude measurement log lines (diff)
downloadsynapse-d375e0038e74ca29da4a1bb9bd56797326357cf0.tar.xz
Log duration of action generator
-rw-r--r--synapse/push/action_generator.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/synapse/push/action_generator.py b/synapse/push/action_generator.py
index 9b208668b6..e2b74f5aa2 100644
--- a/synapse/push/action_generator.py
+++ b/synapse/push/action_generator.py
@@ -17,6 +17,7 @@ from twisted.internet import defer
 
 from .bulk_push_rule_evaluator import evaluator_for_event
 
+from synapse.util.logutils import log_duration
 from synapse.util.metrics import Measure
 
 import logging
@@ -39,13 +40,15 @@ class ActionGenerator:
     @defer.inlineCallbacks
     def handle_push_actions_for_event(self, event, context):
         with Measure(self.clock, "handle_push_actions_for_event"):
-            bulk_evaluator = yield evaluator_for_event(
-                event, self.hs, self.store
-            )
-
-            actions_by_user = yield bulk_evaluator.action_for_event_by_user(
-                event, context.current_state
-            )
+            with log_duration("evaluator_for_event"):
+                bulk_evaluator = yield evaluator_for_event(
+                    event, self.hs, self.store
+                )
+
+            with log_duration("action_for_event_by_user"):
+                actions_by_user = yield bulk_evaluator.action_for_event_by_user(
+                    event, context.current_state
+                )
 
             context.push_actions = [
                 (uid, actions) for uid, actions in actions_by_user.items()