Log duration of action generator
parent
49fda0f1de
commit
d375e0038e
|
@ -17,6 +17,7 @@ from twisted.internet import defer
|
||||||
|
|
||||||
from .bulk_push_rule_evaluator import evaluator_for_event
|
from .bulk_push_rule_evaluator import evaluator_for_event
|
||||||
|
|
||||||
|
from synapse.util.logutils import log_duration
|
||||||
from synapse.util.metrics import Measure
|
from synapse.util.metrics import Measure
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
@ -39,13 +40,15 @@ class ActionGenerator:
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def handle_push_actions_for_event(self, event, context):
|
def handle_push_actions_for_event(self, event, context):
|
||||||
with Measure(self.clock, "handle_push_actions_for_event"):
|
with Measure(self.clock, "handle_push_actions_for_event"):
|
||||||
bulk_evaluator = yield evaluator_for_event(
|
with log_duration("evaluator_for_event"):
|
||||||
event, self.hs, self.store
|
bulk_evaluator = yield evaluator_for_event(
|
||||||
)
|
event, self.hs, self.store
|
||||||
|
)
|
||||||
|
|
||||||
actions_by_user = yield bulk_evaluator.action_for_event_by_user(
|
with log_duration("action_for_event_by_user"):
|
||||||
event, context.current_state
|
actions_by_user = yield bulk_evaluator.action_for_event_by_user(
|
||||||
)
|
event, context.current_state
|
||||||
|
)
|
||||||
|
|
||||||
context.push_actions = [
|
context.push_actions = [
|
||||||
(uid, actions) for uid, actions in actions_by_user.items()
|
(uid, actions) for uid, actions in actions_by_user.items()
|
||||||
|
|
Loading…
Reference in New Issue