diff options
author | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-07-16 13:29:56 +0100 |
---|---|---|
committer | Olivier Wilkinson (reivilibre) <olivier@librepush.net> | 2019-07-17 09:46:01 +0100 |
commit | 20ae4afe7e1b919a48466014b1ba74a3604eb23c (patch) | |
tree | 897c1deacf22158eda0773fff6503947d67d2dda | |
parent | Merge pull request #5597 from matrix-org/erikj/admin_api_cmd (diff) | |
download | synapse-20ae4afe7e1b919a48466014b1ba74a3604eb23c.tar.xz |
Create room_stats rows for new rooms. #5624
Signed-off-by: Olivier Wilkinson (reivilibre) <olivier@librepush.net>
-rw-r--r-- | synapse/handlers/stats.py | 17 |
1 files changed, 17 insertions, 0 deletions
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")} |