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.

12 lines
345 B

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