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

  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("[(]", "_"), "gauge", nil, size)
  8. end
  9. end
  10. return { scrape = scrape }