Class: HeapProfiler::Dump::Stats

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

Direct Known Subclasses

GlobalStats

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStats

Returns a new instance of Stats.



13
14
15
16
# File 'lib/heap_profiler/dump.rb', line 13

def initialize
  @count = 0
  @memsize = 0
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



6
7
8
# File 'lib/heap_profiler/dump.rb', line 6

def count
  @count
end

#memsizeObject

Returns the value of attribute memsize.



6
7
8
# File 'lib/heap_profiler/dump.rb', line 6

def memsize
  @memsize
end

Instance Method Details

#process(object) ⇒ Object



8
9
10
11
# File 'lib/heap_profiler/dump.rb', line 8

def process(object)
  @count += 1
  @memsize += object.fetch(:memsize, 0)
end