Remove unneeded timing log lines
This commit is contained in:
@@ -768,14 +768,12 @@ class MessageHandler(BaseHandler):
|
||||
context.prev_state_events
|
||||
)
|
||||
|
||||
with log_duration("add_auth"):
|
||||
yield self.auth.add_auth_events(builder, context)
|
||||
yield self.auth.add_auth_events(builder, context)
|
||||
|
||||
with log_duration("signing"):
|
||||
signing_key = self.hs.config.signing_key[0]
|
||||
add_hashes_and_signatures(
|
||||
builder, self.server_name, signing_key
|
||||
)
|
||||
signing_key = self.hs.config.signing_key[0]
|
||||
add_hashes_and_signatures(
|
||||
builder, self.server_name, signing_key
|
||||
)
|
||||
|
||||
event = builder.build()
|
||||
|
||||
@@ -803,8 +801,7 @@ class MessageHandler(BaseHandler):
|
||||
self.ratelimit(requester)
|
||||
|
||||
try:
|
||||
with log_duration("auth_check"):
|
||||
self.auth.check(event, auth_events=context.current_state)
|
||||
self.auth.check(event, auth_events=context.current_state)
|
||||
except AuthError as err:
|
||||
logger.warn("Denying new event %r because %s", event, err)
|
||||
raise err
|
||||
@@ -901,22 +898,20 @@ class MessageHandler(BaseHandler):
|
||||
|
||||
# this intentionally does not yield: we don't care about the result
|
||||
# and don't need to wait for it.
|
||||
with log_duration("pusherpool"):
|
||||
preserve_fn(self.hs.get_pusherpool().on_new_notifications)(
|
||||
event_stream_id, max_stream_id
|
||||
)
|
||||
preserve_fn(self.hs.get_pusherpool().on_new_notifications)(
|
||||
event_stream_id, max_stream_id
|
||||
)
|
||||
|
||||
destinations = set()
|
||||
with log_duration("destination"):
|
||||
for k, s in context.current_state.items():
|
||||
try:
|
||||
if k[0] == EventTypes.Member:
|
||||
if s.content["membership"] == Membership.JOIN:
|
||||
destinations.add(get_domain_from_id(s.state_key))
|
||||
except SynapseError:
|
||||
logger.warn(
|
||||
"Failed to get destination from event %s", s.event_id
|
||||
)
|
||||
for k, s in context.current_state.items():
|
||||
try:
|
||||
if k[0] == EventTypes.Member:
|
||||
if s.content["membership"] == Membership.JOIN:
|
||||
destinations.add(get_domain_from_id(s.state_key))
|
||||
except SynapseError:
|
||||
logger.warn(
|
||||
"Failed to get destination from event %s", s.event_id
|
||||
)
|
||||
|
||||
with log_duration("on_new_room_event"):
|
||||
with PreserveLoggingContext():
|
||||
@@ -929,7 +924,6 @@ class MessageHandler(BaseHandler):
|
||||
# If invite, remove room_state from unsigned before sending.
|
||||
event.unsigned.pop("invite_room_state", None)
|
||||
|
||||
with log_duration("handle_new_event"):
|
||||
federation_handler.handle_new_event(
|
||||
event, destinations=destinations,
|
||||
)
|
||||
federation_handler.handle_new_event(
|
||||
event, destinations=destinations,
|
||||
)
|
||||
|
||||
@@ -71,14 +71,12 @@ def evaluator_for_event(event, hs, store, current_state):
|
||||
uid for uid, have_pusher in if_users_with_pushers.items() if have_pusher
|
||||
)
|
||||
|
||||
with log_duration("get_receipts_for_room"):
|
||||
users_with_receipts = yield store.get_users_with_read_receipts_in_room(room_id)
|
||||
users_with_receipts = yield store.get_users_with_read_receipts_in_room(room_id)
|
||||
|
||||
# any users with pushers must be ours: they have pushers
|
||||
with log_duration("get_mine_pushers"):
|
||||
for uid in users_with_receipts:
|
||||
if uid in local_users_in_room:
|
||||
user_ids.add(uid)
|
||||
for uid in users_with_receipts:
|
||||
if uid in local_users_in_room:
|
||||
user_ids.add(uid)
|
||||
|
||||
# if this event is an invite event, we may need to run rules for the user
|
||||
# who's been invited, otherwise they won't get told they've been invited
|
||||
@@ -89,8 +87,7 @@ def evaluator_for_event(event, hs, store, current_state):
|
||||
if has_pusher:
|
||||
user_ids.add(invited_user)
|
||||
|
||||
with log_duration("_get_rules"):
|
||||
rules_by_user = yield _get_rules(room_id, user_ids, store)
|
||||
rules_by_user = yield _get_rules(room_id, user_ids, store)
|
||||
|
||||
defer.returnValue(BulkPushRuleEvaluator(
|
||||
room_id, rules_by_user, user_ids, store
|
||||
|
||||
Reference in New Issue
Block a user