Sha256: 1ada765243d94be67b6dce14dad766e8c82075b32c6dc03ba29818c64ab766ee
Contents?: true
Size: 531 Bytes
Versions: 4
Compression:
Stored size: 531 Bytes
Contents
collect do next if not File.readable?('/proc/stat') File.open('/proc/stat') do |file| file.each do |line| key, value = line.chomp.split case key when "ctxt" sampler.emit(:derive, "os.procs.switch", value.to_i) when "processes" sampler.emit(:derive, "os.procs.forks", value.to_i) when "procs_running" sampler.emit(:gauge, "os.procs.running", value.to_i) when "procs_blocked" sampler.emit(:gauge, "os.procs.blocked", value.to_i) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems