Changeset

11492:6da8d9cb355d

MUC: Report number of live rooms to statsmanager Should help inform on whether the cache size should be increased.
author Kim Alvefur <zash@zash.se>
date Sun, 28 Mar 2021 13:22:35 +0200
parents 11491:c3fb802f9e45
children 11493:77f2d45799ed
files plugins/muc/mod_muc.lua
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/mod_muc.lua	Sun Mar 28 13:15:11 2021 +0200
+++ b/plugins/muc/mod_muc.lua	Sun Mar 28 13:22:35 2021 +0200
@@ -182,6 +182,11 @@
 	end
 end);
 
+local measure_rooms_size = module:measure("live_room", "amount");
+module:hook_global("stats-update", function ()
+	measure_rooms_size(rooms:count());
+end);
+
 -- Automatically destroy empty non-persistent rooms
 module:hook("muc-occupant-left",function(event)
 	local room = event.room