Sha256: f84f5f1210df018b75ff94a7d705e0a11347838d1a52dfb41b983cfaf9859d59

Contents?: true

Size: 738 Bytes

Versions: 11

Compression:

Stored size: 738 Bytes

Contents

require 'liquid/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

11 entries across 11 versions & 1 rubygems

Version Path
liquid-ext-1.2.6 lib/liquid/proc_stat.rb
liquid-ext-1.2.5 lib/liquid/proc_stat.rb
liquid-ext-1.2.4 lib/liquid/proc_stat.rb
liquid-ext-1.2.2 lib/liquid/proc_stat.rb
liquid-ext-1.2.1 lib/liquid/proc_stat.rb
liquid-ext-1.2.0 lib/liquid/proc_stat.rb
liquid-ext-1.1.1 lib/liquid/proc_stat.rb
liquid-ext-1.1.0 lib/liquid/proc_stat.rb
liquid-ext-1.0.2 lib/liquid/proc_stat.rb
liquid-ext-1.0.1 lib/liquid/proc_stat.rb
liquid-ext-1.0.0 lib/liquid/proc_stat.rb