Class: ProcStat

Inherits:
Struct
  • Object
show all
Defined in:
lib/madvertise/proc_stat.rb,
lib/madvertise/proc_stat.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockedObject

Returns the value of attribute blocked

Returns:

  • (Object)

    the current value of blocked



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def blocked
  @blocked
end

#cguest_timeObject

Returns the value of attribute cguest_time

Returns:

  • (Object)

    the current value of cguest_time



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def cguest_time
  @cguest_time
end

#cmajfltObject

Returns the value of attribute cmajflt

Returns:

  • (Object)

    the current value of cmajflt



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def cmajflt
  @cmajflt
end

#cminfltObject

Returns the value of attribute cminflt

Returns:

  • (Object)

    the current value of cminflt



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def cminflt
  @cminflt
end

#cnswapObject

Returns the value of attribute cnswap

Returns:

  • (Object)

    the current value of cnswap



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def cnswap
  @cnswap
end

#cstimeObject

Returns the value of attribute cstime

Returns:

  • (Object)

    the current value of cstime



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def cstime
  @cstime
end

#cutimeObject

Returns the value of attribute cutime

Returns:

  • (Object)

    the current value of cutime



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def cutime
  @cutime
end

#delayacct_blkio_ticksObject

Returns the value of attribute delayacct_blkio_ticks

Returns:

  • (Object)

    the current value of delayacct_blkio_ticks



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def delayacct_blkio_ticks
  @delayacct_blkio_ticks
end

#endcodeObject

Returns the value of attribute endcode

Returns:

  • (Object)

    the current value of endcode



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def endcode
  @endcode
end

#exit_signalObject

Returns the value of attribute exit_signal

Returns:

  • (Object)

    the current value of exit_signal



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def exit_signal
  @exit_signal
end

#flagsObject

Returns the value of attribute flags

Returns:

  • (Object)

    the current value of flags



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def flags
  @flags
end

#guest_timeObject

Returns the value of attribute guest_time

Returns:

  • (Object)

    the current value of guest_time



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def guest_time
  @guest_time
end

#itrealvalueObject

Returns the value of attribute itrealvalue

Returns:

  • (Object)

    the current value of itrealvalue



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def itrealvalue
  @itrealvalue
end

#kstkeipObject

Returns the value of attribute kstkeip

Returns:

  • (Object)

    the current value of kstkeip



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def kstkeip
  @kstkeip
end

#kstkespObject

Returns the value of attribute kstkesp

Returns:

  • (Object)

    the current value of kstkesp



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def kstkesp
  @kstkesp
end

#majfltObject

Returns the value of attribute majflt

Returns:

  • (Object)

    the current value of majflt



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def majflt
  @majflt
end

#minfltObject

Returns the value of attribute minflt

Returns:

  • (Object)

    the current value of minflt



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def minflt
  @minflt
end

#niceObject

Returns the value of attribute nice

Returns:

  • (Object)

    the current value of nice



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def nice
  @nice
end

#nswapObject

Returns the value of attribute nswap

Returns:

  • (Object)

    the current value of nswap



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def nswap
  @nswap
end

#num_threadsObject

Returns the value of attribute num_threads

Returns:

  • (Object)

    the current value of num_threads



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def num_threads
  @num_threads
end

#pgrpObject

Returns the value of attribute pgrp

Returns:

  • (Object)

    the current value of pgrp



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def pgrp
  @pgrp
end

#policyObject

Returns the value of attribute policy

Returns:

  • (Object)

    the current value of policy



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def policy
  @policy
end

#ppidObject

Returns the value of attribute ppid

Returns:

  • (Object)

    the current value of ppid



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def ppid
  @ppid
end

#priorityObject

Returns the value of attribute priority

Returns:

  • (Object)

    the current value of priority



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def priority
  @priority
end

#processorObject

Returns the value of attribute processor

Returns:

  • (Object)

    the current value of processor



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def processor
  @processor
end

#rssObject

Returns the value of attribute rss

Returns:

  • (Object)

    the current value of rss



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def rss
  @rss
end

#rsslimObject

Returns the value of attribute rsslim

Returns:

  • (Object)

    the current value of rsslim



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def rsslim
  @rsslim
end

#rt_priorityObject

Returns the value of attribute rt_priority

Returns:

  • (Object)

    the current value of rt_priority



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def rt_priority
  @rt_priority
end

#sessionObject

Returns the value of attribute session

Returns:

  • (Object)

    the current value of session



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def session
  @session
end

#sigcatchObject

Returns the value of attribute sigcatch

Returns:

  • (Object)

    the current value of sigcatch



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def sigcatch
  @sigcatch
end

#sigignoreObject

Returns the value of attribute sigignore

Returns:

  • (Object)

    the current value of sigignore



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def sigignore
  @sigignore
end

#signalObject

Returns the value of attribute signal

Returns:

  • (Object)

    the current value of signal



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def signal
  @signal
end

#startcodeObject

Returns the value of attribute startcode

Returns:

  • (Object)

    the current value of startcode



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def startcode
  @startcode
end

#startstackObject

Returns the value of attribute startstack

Returns:

  • (Object)

    the current value of startstack



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def startstack
  @startstack
end

#starttimeObject

Returns the value of attribute starttime

Returns:

  • (Object)

    the current value of starttime



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def starttime
  @starttime
end

#stimeObject

Returns the value of attribute stime

Returns:

  • (Object)

    the current value of stime



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def stime
  @stime
end

#tpgidObject

Returns the value of attribute tpgid

Returns:

  • (Object)

    the current value of tpgid



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def tpgid
  @tpgid
end

#tty_nrObject

Returns the value of attribute tty_nr

Returns:

  • (Object)

    the current value of tty_nr



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def tty_nr
  @tty_nr
end

#utimeObject

Returns the value of attribute utime

Returns:

  • (Object)

    the current value of utime



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def utime
  @utime
end

#vsizeObject

Returns the value of attribute vsize

Returns:

  • (Object)

    the current value of vsize



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def vsize
  @vsize
end

#wchanObject

Returns the value of attribute wchan

Returns:

  • (Object)

    the current value of wchan



3
4
5
# File 'lib/madvertise/proc_stat.rb', line 3

def wchan
  @wchan
end

Class Method Details

.readObject



48
49
50
51
# File 'lib/madvertise/proc_stat.rb', line 48

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

Instance Method Details

#pagesizeObject



53
54
55
# File 'lib/madvertise/proc_stat.rb', line 53

def pagesize
  Sysconf.sysconf(:page_size)
end