Class: HealthMode::SwapMetric

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.free_memoryObject

Returns the value of attribute free_memory.



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

def free_memory
  @free_memory
end

.system_metricsObject

Returns the value of attribute system_metrics.



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

def system_metrics
  @system_metrics
end

.total_memoryObject

Returns the value of attribute total_memory.



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

def total_memory
  @total_memory
end

.used_memoryObject

Returns the value of attribute used_memory.



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

def used_memory
  @used_memory
end

Class Method Details

.current_stateObject



9
10
11
12
13
14
15
16
# File 'lib/metrics/swap_metric.rb', line 9

def current_state
  refresh_state
  {
    "swap_total" => @total_memory,
    "swap_used" => @used_memory,
    "swap_free" => @free_memory
  }
end