diff options
author | Erik Johnston <erik@matrix.org> | 2016-05-31 12:01:38 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-05-31 12:01:38 +0100 |
commit | d375e0038e74ca29da4a1bb9bd56797326357cf0 (patch) | |
tree | 6b428a58f7cb2a505a4cf9634176d27fbcb5cfca | |
parent | Add some crude measurement log lines (diff) | |
download | synapse-d375e0038e74ca29da4a1bb9bd56797326357cf0.tar.xz |
Log duration of action generator
-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() |