Class: RuntimeProfiler::Profiler
- Inherits:
-
Object
- Object
- RuntimeProfiler::Profiler
- Defined in:
- lib/runtime_profiler/profiler.rb
Instance Attribute Summary collapse
-
#profiled_constants ⇒ Object
Returns the value of attribute profiled_constants.
Instance Method Summary collapse
-
#initialize(constants) ⇒ Profiler
constructor
A new instance of Profiler.
- #profile!(key) ⇒ Object
Constructor Details
#initialize(constants) ⇒ Profiler
Returns a new instance of Profiler.
11 12 13 14 |
# File 'lib/runtime_profiler/profiler.rb', line 11 def initialize(constants) self.profiled_constants = constants prepare_for_profiling end |
Instance Attribute Details
#profiled_constants ⇒ Object
Returns the value of attribute profiled_constants.
9 10 11 |
# File 'lib/runtime_profiler/profiler.rb', line 9 def profiled_constants @profiled_constants end |
Instance Method Details
#profile!(key) ⇒ Object
16 17 18 19 |
# File 'lib/runtime_profiler/profiler.rb', line 16 def profile!(key) MethodMeter.measure!(key) { yield } save_profiling_data end |