diff options
-rw-r--r-- | synapse/push/action_generator.py | 17 |
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() |