You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

11 lines
329 B

local function scrape()
for line in io.lines("/proc/meminfo") do
local name, size, unit = string.match(line, "([^:]+):%s+(%d+)%s?(k?B?)")
if unit == 'kB' then
size = size * 1024
end
metric("node_memory_" .. name:gsub("[):]", ""):gsub("[(]", "_"), "gauge", nil, size)
end
end
return { scrape = scrape }