aboutsummaryrefslogtreecommitdiffstats
path: root/core/statsmanager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/statsmanager.lua')
-rw-r--r--core/statsmanager.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/statsmanager.lua b/core/statsmanager.lua
index 237b1dd5..2297c959 100644
--- a/core/statsmanager.lua
+++ b/core/statsmanager.lua
@@ -60,9 +60,9 @@ local changed_stats = {};
local stats_extra = {};
if stats then
- function measure(type, name)
+ function measure(type, name, conf)
local f = assert(stats[type], "unknown stat type: "..type);
- return f(name);
+ return f(name, conf);
end
if stats_interval then
@@ -79,6 +79,7 @@ if stats then
if stats.get_stats then
changed_stats, stats_extra = {}, {};
for stat_name, getter in pairs(stats.get_stats()) do
+ -- luacheck: ignore 211/type
local type, value, extra = getter();
local old_value = latest_stats[stat_name];
latest_stats[stat_name] = value;
@@ -97,6 +98,7 @@ if stats then
end
timer.add_task(stats_interval, collect);
prosody.events.add_handler("server-started", function () collect() end, -1);
+ prosody.events.add_handler("server-stopped", function () collect() end, -1);
else
log("debug", "Statistics enabled using %s provider, collection is disabled", stats_provider_name);
end