Class: DevSuite::Performance::Analyzer
- Inherits:
-
Object
- Object
- DevSuite::Performance::Analyzer
- Defined in:
- lib/dev_suite/performance/analyzer.rb
Instance Method Summary collapse
-
#analyze(&block) ⇒ Object
Analyzes the performance of the given block.
-
#initialize(description: "Block") ⇒ Analyzer
constructor
A new instance of Analyzer.
Constructor Details
#initialize(description: "Block") ⇒ Analyzer
Returns a new instance of Analyzer.
6 7 8 9 |
# File 'lib/dev_suite/performance/analyzer.rb', line 6 def initialize(description: "Block") @description = description @profiler_manager = ProfilerManager.new end |
Instance Method Details
#analyze(&block) ⇒ Object
Analyzes the performance of the given block
14 15 16 17 18 19 20 |
# File 'lib/dev_suite/performance/analyzer.rb', line 14 def analyze(&block) raise ArgumentError, "No block given" unless block_given? outcome = @profiler_manager.run(&block) generate_report(@profiler_manager.results) outcome end |