Sha256: 38f91e2d88b1687009e90a953bd377e411f8a3d3f397bf06e83b014e7521133b

Contents?: true

Size: 742 Bytes

Versions: 22

Compression:

Stored size: 742 Bytes

Contents

require 'madvertise/sysconf'

ProcStat = Struct.new(
  :ppid,
  :pgrp,
  :session,
  :tty_nr,
  :tpgid,
  :flags,
  :minflt,
  :cminflt,
  :majflt,
  :cmajflt,
  :utime,
  :stime,
  :cutime,
  :cstime,
  :priority,
  :nice,
  :num_threads,
  :itrealvalue,
  :starttime,
  :vsize,
  :rss,
  :rsslim,
  :startcode,
  :endcode,
  :startstack,
  :kstkesp,
  :kstkeip,
  :signal,
  :blocked,
  :sigignore,
  :sigcatch,
  :wchan,
  :nswap,
  :cnswap,
  :exit_signal,
  :processor,
  :rt_priority,
  :policy,
  :delayacct_blkio_ticks,
  :guest_time,
  :cguest_time
)

class ProcStat
  def self.read
    stat = File.read("/proc/self/stat").chomp.split
    new(*stat[3..40].map(&:to_i))
  end

  def pagesize
    Sysconf.sysconf(:page_size)
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
madvertise-ext-0.9.7 lib/madvertise/proc_stat.rb
madvertise-ext-0.9.6 lib/madvertise/proc_stat.rb
madvertise-ext-0.9.5 lib/madvertise/proc_stat.rb
madvertise-ext-0.9.4 lib/madvertise/proc_stat.rb
madvertise-ext-0.9.3 lib/madvertise/proc_stat.rb
madvertise-ext-0.9.2 lib/madvertise/proc_stat.rb
madvertise-ext-0.9.1 lib/madvertise/proc_stat.rb
madvertise-ext-0.9.0 lib/madvertise/proc_stat.rb
madvertise-ext-0.8.0 lib/madvertise/proc_stat.rb
madvertise-ext-0.7.1 lib/madvertise/proc_stat.rb
madvertise-ext-0.7.0 lib/madvertise/proc_stat.rb
madvertise-ext-0.6.6 lib/madvertise/proc_stat.rb
madvertise-ext-0.6.5 lib/madvertise/proc_stat.rb
madvertise-ext-0.6.4 lib/madvertise/proc_stat.rb
madvertise-ext-0.6.3 lib/madvertise/proc_stat.rb
madvertise-ext-0.6.2 lib/madvertise/proc_stat.rb
madvertise-ext-0.6.1 lib/madvertise/proc_stat.rb
madvertise-ext-0.6.0 lib/madvertise/proc_stat.rb
madvertise-ext-0.5.3 lib/madvertise/proc_stat.rb
madvertise-ext-0.5.2 lib/madvertise/proc_stat.rb