Class: HealthMode::MemoryMetric

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.buffers_memoryObject

Returns the value of attribute buffers_memory.



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

def buffers_memory
  @buffers_memory
end

.cached_memoryObject

Returns the value of attribute cached_memory.



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

def cached_memory
  @cached_memory
end

.free_memoryObject

Returns the value of attribute free_memory.



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

def free_memory
  @free_memory
end

.normalized_free_memoryObject

Returns the value of attribute normalized_free_memory.



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

def normalized_free_memory
  @normalized_free_memory
end

.normalized_used_memoryObject

Returns the value of attribute normalized_used_memory.



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

def normalized_used_memory
  @normalized_used_memory
end

.shared_memoryObject

Returns the value of attribute shared_memory.



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

def shared_memory
  @shared_memory
end

.system_metricsObject

Returns the value of attribute system_metrics.



4
5
6
# File 'lib/metrics/memory_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/memory_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/memory_metric.rb', line 4

def used_memory
  @used_memory
end

Class Method Details

.current_stateObject



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

def current_state
  refresh_state
  {
    "mem_total" => @total_memory,
    "mem_used" => @used_memory,
    "mem_free" => @free_memory,
    "mem_shared" => @shared_memory,
    "mem_buffers" => @buffers_memory,
    "mem_cached" => @cached_memory,
    "mem_used_normalized" => @normalized_used_memory,
    "mem_free_normalized" => @normalized_free_memory
  }
end