Class: HealthMode::CPUMetric

Inherits:
Metric
  • Object
show all
Defined in:
lib/metrics/cpu_metric.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cpu_idleObject

Returns the value of attribute cpu_idle.



4
5
6
# File 'lib/metrics/cpu_metric.rb', line 4

def cpu_idle
  @cpu_idle
end

.cpu_iowaitObject

Returns the value of attribute cpu_iowait.



4
5
6
# File 'lib/metrics/cpu_metric.rb', line 4

def cpu_iowait
  @cpu_iowait
end

.cpu_irqObject

Returns the value of attribute cpu_irq.



4
5
6
# File 'lib/metrics/cpu_metric.rb', line 4

def cpu_irq
  @cpu_irq
end

.cpu_niceObject

Returns the value of attribute cpu_nice.



4
5
6
# File 'lib/metrics/cpu_metric.rb', line 4

def cpu_nice
  @cpu_nice
end

.cpu_softirqObject

Returns the value of attribute cpu_softirq.



4
5
6
# File 'lib/metrics/cpu_metric.rb', line 4

def cpu_softirq
  @cpu_softirq
end

.cpu_systemObject

Returns the value of attribute cpu_system.



4
5
6
# File 'lib/metrics/cpu_metric.rb', line 4

def cpu_system
  @cpu_system
end

.cpu_userObject

Returns the value of attribute cpu_user.



4
5
6
# File 'lib/metrics/cpu_metric.rb', line 4

def cpu_user
  @cpu_user
end

.system_metricsObject

Returns the value of attribute system_metrics.



4
5
6
# File 'lib/metrics/cpu_metric.rb', line 4

def system_metrics
  @system_metrics
end

Class Method Details

.current_stateObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/metrics/cpu_metric.rb', line 13

def current_state
  refresh_state
  {
    "cpu_user" => @cpu_user,
    "cpu_nice" => @cpu_nice,
    "cpu_system" => @cpu_system,
    "cpu_iowait" => @cpu_iowait,
    "cpu_irq" => @cpu_irq,
    "cpu_idle" => @cpu_idle,
    "cpu_softirq" => @cpu_softirq
  }
end