diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-04-04 17:30:02 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-04-04 17:30:02 +0100 |
commit | 912c456d60e521e6e11886c41a93e1f47b50c149 (patch) | |
tree | 3bfa4de409184dd73b87071e4ef501ba8da4ed5c /synapse/storage | |
parent | Increase member limiter to 20 (diff) | |
download | synapse-912c456d60e521e6e11886c41a93e1f47b50c149.tar.xz |
Logging for get_users_in_room
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/roommember.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py index ba1afafaa5..039188a3be 100644 --- a/synapse/storage/roommember.py +++ b/synapse/storage/roommember.py @@ -66,6 +66,7 @@ class RoomMemberWorkerStore(EventsWorkerStore): defer.returnValue(hosts) @cached(max_entries=100000, iterable=True) + @defer.inlineCallbacks def get_users_in_room(self, room_id): def f(txn): sql = ( @@ -79,7 +80,14 @@ class RoomMemberWorkerStore(EventsWorkerStore): txn.execute(sql, (room_id, Membership.JOIN,)) return [to_ascii(r[0]) for r in txn] - return self.runInteraction("get_users_in_room", f) + start_time = self._clock.time_msec() + result = yield self.runInteraction("get_users_in_room", f) + end_time = self._clock.time_msec() + logger.info( + "Fetched room membership for %s (%i users) in %i ms", + room_id, len(result), end_time - start_time, + ) + defer.returnValue(result) @cached() def get_invited_rooms_for_user(self, user_id): |