Class: Datadog::Profiler
- Inherits:
-
Object
- Object
- Datadog::Profiler
- Defined in:
- lib/ddtrace/profiling/profiler.rb
Overview
Profiling entry point, which coordinates collectors and a scheduler
Instance Attribute Summary collapse
-
#collectors ⇒ Object
readonly
Returns the value of attribute collectors.
-
#scheduler ⇒ Object
readonly
Returns the value of attribute scheduler.
Instance Method Summary collapse
-
#initialize(collectors, scheduler) ⇒ Profiler
constructor
A new instance of Profiler.
- #shutdown! ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize(collectors, scheduler) ⇒ Profiler
Returns a new instance of Profiler.
9 10 11 12 |
# File 'lib/ddtrace/profiling/profiler.rb', line 9 def initialize(collectors, scheduler) @collectors = collectors @scheduler = scheduler end |
Instance Attribute Details
#collectors ⇒ Object (readonly)
Returns the value of attribute collectors.
5 6 7 |
# File 'lib/ddtrace/profiling/profiler.rb', line 5 def collectors @collectors end |
#scheduler ⇒ Object (readonly)
Returns the value of attribute scheduler.
5 6 7 |
# File 'lib/ddtrace/profiling/profiler.rb', line 5 def scheduler @scheduler end |
Instance Method Details
#shutdown! ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ddtrace/profiling/profiler.rb', line 19 def shutdown! Datadog.logger.debug('Shutting down profiler') collectors.each do |collector| collector.enabled = false collector.stop(true) end scheduler.enabled = false scheduler.stop(true) end |
#start ⇒ Object
14 15 16 17 |
# File 'lib/ddtrace/profiling/profiler.rb', line 14 def start collectors.each(&:start) scheduler.start end |