Software /
code /
prosody-modules
Comparison
mod_measure_malloc/mod_measure_malloc.lua @ 4758:b9af1ccac98b
mod_measure_malloc: Fix accidental global variable write [luacheck]
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 07 Nov 2021 14:25:58 +0100 |
parent | 4575:5b4f43b90766 |
comparison
equal
deleted
inserted
replaced
4757:8e22b858628f | 4758: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); |