Module: Datadog::Profiling
- Defined in:
- lib/datadog/profiling.rb,
lib/datadog/profiling/ext.rb,
lib/datadog/profiling/flush.rb,
lib/datadog/profiling/exporter.rb,
lib/datadog/profiling/profiler.rb,
lib/datadog/profiling/component.rb,
lib/datadog/profiling/scheduler.rb,
lib/datadog/profiling/tasks/exec.rb,
lib/datadog/profiling/tasks/help.rb,
lib/datadog/profiling/tag_builder.rb,
lib/datadog/profiling/tasks/setup.rb,
lib/datadog/profiling/http_transport.rb,
lib/datadog/profiling/stack_recorder.rb,
lib/datadog/profiling/collectors/info.rb,
lib/datadog/profiling/encoded_profile.rb,
lib/datadog/profiling/collectors/stack.rb,
lib/datadog/profiling/native_extension.rb,
lib/datadog/profiling/sequence_tracker.rb,
lib/datadog/profiling/ext/exec_monkey_patch.rb,
lib/datadog/profiling/ext/dir_monkey_patches.rb,
lib/datadog/profiling/collectors/thread_context.rb,
lib/datadog/profiling/collectors/code_provenance.rb,
lib/datadog/profiling/collectors/idle_sampling_helper.rb,
lib/datadog/profiling/collectors/dynamic_sampling_rate.rb,
lib/datadog/profiling/collectors/cpu_and_wall_time_worker.rb,
ext/datadog_profiling_native_extension/profiling.c,
ext/datadog_profiling_native_extension/native_extension_helpers.rb
Overview
Defined Under Namespace
Modules: Collectors, Component, Ext, NativeExtension, NativeExtensionHelpers, SequenceTracker, TagBuilder, Tasks
Classes: EncodedProfile, ExistingSignalHandler, Exporter, Flush, HttpTransport, Profiler, Scheduler, StackRecorder
Class Method Summary
collapse
Class Method Details
.enabled? ⇒ Boolean
67
68
69
|
# File 'lib/datadog/profiling.rb', line 67
def self.enabled?
!!Datadog.send(:components).profiler
end
|
.replace_noop_allocation_count ⇒ Object
82
83
84
85
86
87
88
89
|
# File 'lib/datadog/profiling.rb', line 82
def self.replace_noop_allocation_count
class << self
remove_method :allocation_count
def allocation_count
Datadog::Profiling::Collectors::CpuAndWallTimeWorker._native_allocation_count
end
end
end
|
.start_if_enabled ⇒ Boolean
Starts the profiler, if the profiler is supported by in
this runtime environment and if the profiler has been enabled
in configuration.
31
32
33
34
35
36
37
38
39
|
# File 'lib/datadog/profiling.rb', line 31
def self.start_if_enabled
profiler = Datadog.send(:components).profiler
profiler&.start
!!profiler
end
|
.supported? ⇒ Boolean
14
15
16
|
# File 'lib/datadog/profiling.rb', line 14
def self.supported?
unsupported_reason.nil?
end
|
.unsupported_reason ⇒ Object
18
19
20
21
22
23
|
# File 'lib/datadog/profiling.rb', line 18
def self.unsupported_reason
native_library_compilation_skipped? || native_library_failed_to_load?
end
|
.wait_until_running(timeout_seconds: 5) ⇒ Object
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/datadog/profiling.rb', line 71
def self.wait_until_running(timeout_seconds: 5)
profiler = Datadog.send(:components).profiler
if profiler
worker = profiler.send(:worker)
worker.wait_until_running(timeout_seconds: timeout_seconds)
else
raise "Profiler not enabled or available"
end
end
|