mod_muc_webchat_url: Fix default url
[prosody-modules.git] / mod_measure_malloc / mod_measure_malloc.lua
blobee581d521a5f86bd186d59ccda0186890fd02f7c
1 module:set_global();
3 local measure = require"core.statsmanager".measure;
4 local pposix = require"util.pposix";
6 local measures = {};
7 setmetatable(measures, {
8 __index = function (t, k)
9 local m = measure("amount", "memory."..k); t[k] = m; return m;
10 end
11 });
12 module:hook("stats-update", function ()
13 local m = measures;
14 for k, v in pairs(pposix.meminfo()) do
15 m[k](v);
16 end
17 end);