Class: HeapProfiler::Dump::Stats
- Inherits:
-
Object
- Object
- HeapProfiler::Dump::Stats
- Defined in:
- lib/heap_profiler/dump.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#memsize ⇒ Object
Returns the value of attribute memsize.
Instance Method Summary collapse
-
#initialize ⇒ Stats
constructor
A new instance of Stats.
- #process(object) ⇒ Object
Constructor Details
#initialize ⇒ Stats
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
#count ⇒ Object
Returns the value of attribute count.
6 7 8 |
# File 'lib/heap_profiler/dump.rb', line 6 def count @count end |
#memsize ⇒ Object
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 |