module Ganymed class Collector class Procs < Base def collect! return if not File.readable?('/proc/stat') File.open('/proc/stat').each do |line| next if not line =~ /^procs_/ key, value = line.chomp.split if key == "procs_running" @sampler.emit(:gauge, "os.procs.running", value.to_i) elsif key == "procs_blocked" @sampler.emit(:gauge, "os.procs.blocked", value.to_i) end end end def interval @config.interval.tap{} or 0.2 end end end end