mod_measure_malloc/mod_measure_malloc.lua
changeset 4762 b9af1ccac98b
parent 4579 5b4f43b90766
equal deleted inserted replaced
4761:8e22b858628f 4762:b9af1ccac98b
    23 	"gauge", "malloc_heap_returnable", "bytes",
    23 	"gauge", "malloc_heap_returnable", "bytes",
    24 	"Returnable bytes"
    24 	"Returnable bytes"
    25 ):with_labels();
    25 ):with_labels();
    26 
    26 
    27 module:hook("stats-update", function ()
    27 module:hook("stats-update", function ()
    28 	meminfo = pposix.meminfo();
    28 	local meminfo = pposix.meminfo();
    29 	if meminfo.allocated then
    29 	if meminfo.allocated then
    30 		allocated:with_labels("sbrk"):set(meminfo.allocated);
    30 		allocated:with_labels("sbrk"):set(meminfo.allocated);
    31 	end
    31 	end
    32 	if meminfo.allocated_mmap then
    32 	if meminfo.allocated_mmap then
    33 		allocated:with_labels("mmap"):set(meminfo.allocated_mmap);
    33 		allocated:with_labels("mmap"):set(meminfo.allocated_mmap);