class MemoryTracker::GcStatDelta

Attributes

stats[R]

Public Class Methods

new(before, after) click to toggle source
# File lib/memory_tracker/gc_stat.rb, line 105
def initialize(before, after)
  @after = after
  @stats = after.inject({}) do |h, (k, v)|
    h[k] = after[k] - before[k]
    h
  end
end

Public Instance Methods

custom() click to toggle source
# File lib/memory_tracker/gc_stat.rb, line 113
def custom
  return unless stats[:total_allocated_object] && stats[:total_freed_object]
  h = {}
  h[:total_allocated_object] = stats[:total_allocated_object]
  h[:count] = stats[:count]
  h[:rss] = stats[:rss]
  h[:heap_used] = @after[:heap_used]
  h[:in_use]    = @after[:total_allocated_object] - @after[:total_freed_object]
  h
end