From 20ae4afe7e1b919a48466014b1ba74a3604eb23c Mon Sep 17 00:00:00 2001 From: "Olivier Wilkinson (reivilibre)" Date: Tue, 16 Jul 2019 13:29:56 +0100 Subject: [PATCH] Create room_stats rows for new rooms. #5624 Signed-off-by: Olivier Wilkinson (reivilibre) --- synapse/handlers/stats.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/synapse/handlers/stats.py b/synapse/handlers/stats.py index a0ee8db988..155232e5c3 100644 --- a/synapse/handlers/stats.py +++ b/synapse/handlers/stats.py @@ -246,6 +246,23 @@ class StatsHandler(StateDeltasHandler): }, ) + # Also add room stats with just the one state event + # (the room creation state event) + yield self.store.update_stats( + "room", + room_id, + now, + { + "bucket_size": self.stats_bucket_size, + "current_state_events": 1, + "joined_members": 0, + "invited_members": 0, + "left_members": 0, + "banned_members": 0, + "state_events": 1, + }, + ) + elif typ == EventTypes.JoinRules: yield self.store.update_room_state( room_id, {"join_rules": event_content.get("join_rule")}