Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
11491:c3fb802f9e45 | 11492:6da8d9cb355d |
---|---|
178 local ok, err = room_save(room, nil, true); -- Force to disk | 178 local ok, err = room_save(room, nil, true); -- Force to disk |
179 if not ok then | 179 if not ok then |
180 module:log("error", "Failed to swap inactive room %s to disk: %s", jid, err); | 180 module:log("error", "Failed to swap inactive room %s to disk: %s", jid, err); |
181 return false; | 181 return false; |
182 end | 182 end |
183 end); | |
184 | |
185 local measure_rooms_size = module:measure("live_room", "amount"); | |
186 module:hook_global("stats-update", function () | |
187 measure_rooms_size(rooms:count()); | |
183 end); | 188 end); |
184 | 189 |
185 -- Automatically destroy empty non-persistent rooms | 190 -- Automatically destroy empty non-persistent rooms |
186 module:hook("muc-occupant-left",function(event) | 191 module:hook("muc-occupant-left",function(event) |
187 local room = event.room | 192 local room = event.room |