Comparison

mod_measure_malloc/mod_measure_malloc.lua @ 3367:a83eed629d4b

mod_measure_malloc: Use the 'amount' measure type Here too
author Kim Alvefur <zash@zash.se>
date Mon, 29 Oct 2018 01:33:14 +0100
parent 2708:07d6077d2db7
child 4575:5b4f43b90766
comparison
equal deleted inserted replaced
3366:6d1c5ecf72c1 3367:a83eed629d4b
4 local pposix = require"util.pposix"; 4 local pposix = require"util.pposix";
5 5
6 local measures = {}; 6 local measures = {};
7 setmetatable(measures, { 7 setmetatable(measures, {
8 __index = function (t, k) 8 __index = function (t, k)
9 local m = measure("sizes", "memory."..k); t[k] = m; return m; 9 local m = measure("amount", "memory."..k); t[k] = m; return m;
10 end 10 end
11 }); 11 });
12 module:hook("stats-update", function () 12 module:hook("stats-update", function ()
13 local m = measures; 13 local m = measures;
14 for k, v in pairs(pposix.meminfo()) do 14 for k, v in pairs(pposix.meminfo()) do