summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-01 17:33:55 +0100
committerErik Johnston <erik@matrix.org>2016-06-01 17:33:55 +0100
commit025458363f2d724cdae22aeab34123ee98e9e4ef (patch)
treea88f9605757f8fbfd59c6e56fdf7d929babdd9b4
parentMerge branch 'develop' of github.com:matrix-org/synapse into erikj/timings (diff)
downloadsynapse-025458363f2d724cdae22aeab34123ee98e9e4ef.tar.xz
Remove unneeded timing log lines
-rw-r--r--synapse/handlers/message.py48
-rw-r--r--synapse/push/bulk_push_rule_evaluator.py13
2 files changed, 26 insertions, 35 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index 0b1aa8218e..90c614c9ef 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -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,
+        )
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py
index 25ed08458f..6599abf1ab 100644
--- a/synapse/push/bulk_push_rule_evaluator.py
+++ b/synapse/push/bulk_push_rule_evaluator.py
@@ -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