Method: Linux::Kstat#initialize

Defined in:
lib/linux/kstat.rb

#initializeKstat

Create a new Linux::Kstat instance. You can access the information stored in this object the same way you would access a hash key. Note that all keys are symbols.

Example:

kstat = Linux::Kstat.new

kstat[:cpu] => {
  :idle     => 250713454,
  :iowait   => 2745691,
  :irq      => 39717,
  :softirq  => 31323,
  :system   => 1881655,
  :nice     => 117158,
  :user     => 7137418
}

kstat[:processes] # => 1299560


40
41
42
# File 'lib/linux/kstat.rb', line 40

def initialize
  @hash = get_proc_stat_info
end