summary refs log tree commit diff
path: root/synapse/federation
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-02-26 12:19:21 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-02-26 12:19:21 +0000
commit1ac54c6dc125f3b866dace50149f31d7e545730f (patch)
tree27801a0a7354e3fb7349f5d52501225970f19528 /synapse/federation
parentMerge branch 'master' into develop (diff)
parentadd some metrics on the federation sender (#6160) (diff)
downloadsynapse-1ac54c6dc125f3b866dace50149f31d7e545730f.tar.xz
add some metrics on the federation sender (#6160)
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/sender/__init__.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/synapse/federation/sender/__init__.py b/synapse/federation/sender/__init__.py
index 36f6d470dc..4ebb0e8bc0 100644
--- a/synapse/federation/sender/__init__.py
+++ b/synapse/federation/sender/__init__.py
@@ -38,7 +38,7 @@ from synapse.metrics import (
     events_processed_counter,
 )
 from synapse.metrics.background_process_metrics import run_as_background_process
-from synapse.util.metrics import measure_func
+from synapse.util.metrics import Measure, measure_func
 
 logger = logging.getLogger(__name__)
 
@@ -183,8 +183,8 @@ class FederationSender(object):
                         # Otherwise if the last member on a server in a room is
                         # banned then it won't receive the event because it won't
                         # be in the room after the ban.
-                        destinations = yield self.state.get_current_hosts_in_room(
-                            event.room_id, latest_event_ids=event.prev_event_ids()
+                        destinations = yield self.state.get_hosts_in_room_at_events(
+                            event.room_id, event_ids=event.prev_event_ids()
                         )
                     except Exception:
                         logger.exception(
@@ -207,8 +207,9 @@ class FederationSender(object):
 
                 @defer.inlineCallbacks
                 def handle_room_events(events):
-                    for event in events:
-                        yield handle_event(event)
+                    with Measure(self.clock, "handle_room_events"):
+                        for event in events:
+                            yield handle_event(event)
 
                 events_by_room = {}
                 for event in events: