Class: DevSuite::Performance::Profiler::Memory
- Inherits:
-
Base
- Object
- Utils::Construct::Component::Base
- Base
- DevSuite::Performance::Profiler::Memory
- Defined in:
- lib/dev_suite/performance/profiler/memory.rb
Instance Attribute Summary collapse
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
Instance Method Summary collapse
-
#initialize ⇒ Memory
constructor
A new instance of Memory.
- #run(&block) ⇒ Object
Methods inherited from Utils::Construct::Component::Base
Constructor Details
#initialize ⇒ Memory
Returns a new instance of Memory.
9 10 11 12 13 |
# File 'lib/dev_suite/performance/profiler/memory.rb', line 9 def initialize super @memory_usage = Data::MemoryUsage.new @memory_points = [] end |
Instance Attribute Details
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
7 8 9 |
# File 'lib/dev_suite/performance/profiler/memory.rb', line 7 def stats @stats end |
Instance Method Details
#run(&block) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/dev_suite/performance/profiler/memory.rb', line 15 def run(&block) before_memory = record_memory result = yield after_memory = record_memory @stats = calculate_stats(before_memory, after_memory) result end |