class Metrux::Plugins::Gc

Public Instance Methods

data() click to toggle source
# File lib/metrux/plugins/gc.rb, line 4
def data
  {
    count: count, major_count: major_count, minor_count: minor_count,
    total_allocated_objects: total_allocated_objects,
    heap_live: heap_live, heap_free: heap_free
  }
end
key() click to toggle source
# File lib/metrux/plugins/gc.rb, line 12
def key
  'gc'.freeze
end

Private Instance Methods

count() click to toggle source
# File lib/metrux/plugins/gc.rb, line 18
def count
  ::GC.count
end
gc_stats() click to toggle source
# File lib/metrux/plugins/gc.rb, line 47
def gc_stats
  ::GC.stat
end
heap_free() click to toggle source
# File lib/metrux/plugins/gc.rb, line 41
def heap_free
  gc_stats[:heap_free_slots] ||
    gc_stats[:heap_free_slot] ||
    gc_stats[:heap_free_num]
end
heap_live() click to toggle source
# File lib/metrux/plugins/gc.rb, line 35
def heap_live
  gc_stats[:heap_live_slots] ||
    gc_stats[:heap_live_slot] ||
    gc_stats[:heap_live_num]
end
major_count() click to toggle source
# File lib/metrux/plugins/gc.rb, line 22
def major_count
  gc_stats[:major_gc_count]
end
minor_count() click to toggle source
# File lib/metrux/plugins/gc.rb, line 26
def minor_count
  gc_stats[:minor_gc_count]
end
total_allocated_objects() click to toggle source
# File lib/metrux/plugins/gc.rb, line 30
def total_allocated_objects
  gc_stats[:total_allocated_objects] ||
    gc_stats[:total_allocated_object]
end