Class: HeapProfiler::Dump::GlobalStats

Inherits:
Stats
  • Object
show all
Defined in:
lib/heap_profiler/dump.rb

Instance Attribute Summary

Attributes inherited from Stats

#count, #memsize

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Stats

#initialize

Constructor Details

This class inherits a constructor from HeapProfiler::Dump::Stats

Class Method Details

.from(dump) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/heap_profiler/dump.rb', line 21

def from(dump)
  stats = new
  dump.each_object do |object|
    stats.process(object)
  end
  stats
end

Instance Method Details

#per_typeObject



35
36
37
# File 'lib/heap_profiler/dump.rb', line 35

def per_type
  @per_type = Hash.new { |h, k| h[k] = Stats.new }
end

#process(object) ⇒ Object



30
31
32
33
# File 'lib/heap_profiler/dump.rb', line 30

def process(object)
  super
  per_type[object[:type]].process(object)
end