Class: Datadog::Profiling::Profiler
Overview
Profiling entry point, which coordinates the worker and scheduler threads
Instance Method Summary
collapse
#after_fork!, extended, #fork_pid, #forked?, included, #update_fork_pid!
Constructor Details
#initialize(worker:, scheduler:) ⇒ Profiler
15
16
17
18
|
# File 'lib/datadog/profiling/profiler.rb', line 15
def initialize(worker:, scheduler:)
@worker = worker
@scheduler = scheduler
end
|
Instance Method Details
#enabled? ⇒ Boolean
20
21
22
|
# File 'lib/datadog/profiling/profiler.rb', line 20
def enabled?
scheduler.running?
end
|
#shutdown! ⇒ Object
34
35
36
37
38
39
|
# File 'lib/datadog/profiling/profiler.rb', line 34
def shutdown!
Datadog.logger.debug("Shutting down profiler")
stop_worker
stop_scheduler
end
|
#start ⇒ Object
24
25
26
27
28
29
30
31
32
|
# File 'lib/datadog/profiling/profiler.rb', line 24
def start
after_fork! do
worker.reset_after_fork
scheduler.reset_after_fork
end
worker.start(on_failure_proc: proc { component_failed(:worker) })
scheduler.start(on_failure_proc: proc { component_failed(:scheduler) })
end
|