Sha256: 9c97150eb292a9ddbf4dc52e6f65020131c07e6a8c360e137e4c8f882f583f2b

Contents?: true

Size: 529 Bytes

Versions: 5

Compression:

Stored size: 529 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"
        Metriks.derive("os.sched.switch").mark(value.to_i)
      when "processes"
        Metriks.derive("os.forks").mark(value.to_i)
      when "procs_running"
        Metriks.histogram("os.procs:running").update(value.to_i)
      when "procs_blocked"
        Metriks.histogram("os.procs:blocked").update(value.to_i)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ganymed-0.5.2 lib/ganymed/collectors/process.rb
ganymed-0.5.1 lib/ganymed/collectors/process.rb
ganymed-0.5.0 lib/ganymed/collectors/process.rb
ganymed-0.4.4 lib/ganymed/collectors/process.rb
ganymed-0.4.3 lib/ganymed/collectors/process.rb