Module: RequireProfiler::RubyProfiling
- Defined in:
- lib/require_profiler/ruby_profiling.rb
Overview
This module contains helpers to activate specific files loading profiling using Stackprof or Vernier (so you can dig deeper into why a particular file is slow to require)
Class Attribute Summary collapse
-
.enabled ⇒ Object
Returns the value of attribute enabled.
-
.profiler ⇒ Object
Returns the value of attribute profiler.
-
.target_path ⇒ Object
Returns the value of attribute target_path.
Class Method Summary collapse
Class Attribute Details
.enabled ⇒ Object
Returns the value of attribute enabled.
9 10 11 |
# File 'lib/require_profiler/ruby_profiling.rb', line 9 def enabled @enabled end |
.profiler ⇒ Object
Returns the value of attribute profiler.
9 10 11 |
# File 'lib/require_profiler/ruby_profiling.rb', line 9 def profiler @profiler end |
.target_path ⇒ Object
Returns the value of attribute target_path.
9 10 11 |
# File 'lib/require_profiler/ruby_profiling.rb', line 9 def target_path @target_path end |
Class Method Details
.capture(path) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/require_profiler/ruby_profiling.rb', line 15 def capture(path, &) return yield unless path.end_with?(target_path) if profiler == :stackprof capture_stackprof(path, &) end end |
.enabled? ⇒ Boolean
11 12 13 |
# File 'lib/require_profiler/ruby_profiling.rb', line 11 def enabled? @enabled end |