mod_measure_malloc/mod_measure_malloc.lua
author JC Brand <jc@opkode.com>
Wed, 30 Dec 2020 16:44:21 +0100
changeset 4317 fc5c53d9d340
parent 3371 a83eed629d4b
child 4579 5b4f43b90766
permissions -rw-r--r--
mod_muc_mention_notifications: Send mention notifications from the MUC JID

module:set_global();

local measure = require"core.statsmanager".measure;
local pposix = require"util.pposix";

local measures = {};
setmetatable(measures, {
	__index = function (t, k)
		local m = measure("amount", "memory."..k); t[k] = m; return m;
	end
});
module:hook("stats-update", function ()
	local m = measures;
	for k, v in pairs(pposix.meminfo()) do
		m[k](v);
	end
end);