Diff

plugins/muc/mod_muc.lua @ 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
parent 11215:9ce0a899ff07
child 12010:f995d62044fa
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