Class: Scout::Realtime::Cpu

Inherits:
Metric show all
Includes:
Aggregator
Defined in:
lib/scout_realtime/models/cpu.rb

Constant Summary collapse

FIELDS =
{ :user                  => { 'units' => '%', 'precision' => 1 },
   :system                => { 'units' => '%', 'precision' => 1 },
   :idle                  => { 'units' => '%', 'precision' => 1 },
   :io_wait               => { 'units' => '%', 'precision' => 1, 'label' => 'IO Wait' },
   :steal                 => { 'units' => '%', 'precision' => 1 },
   :interrupts            => { 'units' => '/sec', 'precision' => 1 },
   :procs_running         => { 'units' => '', 'precision' => 0 },
   :procs_blocked         => { 'units' => '', 'precision' => 0 }
}

Instance Attribute Summary

Attributes inherited from Metric

#historical_metrics, #latest_run

Instance Method Summary collapse

Methods included from Aggregator

#update_historical_metrics

Methods inherited from Metric

descendants, metadata, #run!, short_name

Constructor Details

#initializeCpu

Returns a new instance of Cpu.



14
15
16
17
18
19
# File 'lib/scout_realtime/models/cpu.rb', line 14

def initialize
  # load average metrics aren't displayed in scout_realtime and the call to grab this is a system call,
  # which is slow. avoids this.
  @collector = ServerMetrics::Cpu.new(:skip_load => true)
  super
end