Class: Datadog::Profiling::Collectors::ThreadContext
- Inherits:
-
Object
- Object
- Datadog::Profiling::Collectors::ThreadContext
- Defined in:
- lib/datadog/profiling/collectors/thread_context.rb,
ext/ddtrace_profiling_native_extension/collectors_thread_context.c
Overview
Used to trigger sampling of threads, based on external “events”, such as:
-
periodic timer for cpu-time and wall-time
-
VM garbage collection events
-
VM object allocation events
Triggering of this component (e.g. watching for the above “events”) is implemented by Collectors::CpuAndWallTimeWorker. The stack collection itself is handled using the Datadog::Profiling::Collectors::Stack. Almost all of this class is implemented as native code.
Methods prefixed with native are implemented in ‘collectors_thread_context.c`
Defined Under Namespace
Modules: Testing
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(recorder:, max_frames:, tracer:) ⇒ ThreadContext
constructor
A new instance of ThreadContext.
- #inspect ⇒ Object
- #reset_after_fork ⇒ Object
Constructor Details
#initialize(recorder:, max_frames:, tracer:) ⇒ ThreadContext
Returns a new instance of ThreadContext.
17 18 19 20 |
# File 'lib/datadog/profiling/collectors/thread_context.rb', line 17 def initialize(recorder:, max_frames:, tracer:) tracer_context_key = safely_extract_context_key_from(tracer) self.class._native_initialize(self, recorder, max_frames, tracer_context_key) end |
Class Method Details
._native_initialize ⇒ Object
143 |
# File 'ext/ddtrace_profiling_native_extension/collectors_thread_context.c', line 143
static VALUE _native_initialize(VALUE self, VALUE collector_instance, VALUE recorder_instance, VALUE max_frames, VALUE tracer_context_key);
|
._native_inspect ⇒ Object
168 |
# File 'ext/ddtrace_profiling_native_extension/collectors_thread_context.c', line 168
static VALUE _native_inspect(VALUE self, VALUE collector_instance);
|
._native_reset_after_fork ⇒ Object
181 |
# File 'ext/ddtrace_profiling_native_extension/collectors_thread_context.c', line 181
static VALUE _native_reset_after_fork(DDTRACE_UNUSED VALUE self, VALUE collector_instance);
|
Instance Method Details
#inspect ⇒ Object
22 23 24 25 26 27 |
# File 'lib/datadog/profiling/collectors/thread_context.rb', line 22 def inspect # Compose Ruby's default inspect with our custom inspect for the native parts result = super() result[-1] = "#{self.class._native_inspect(self)}>" result end |
#reset_after_fork ⇒ Object
29 30 31 |
# File 'lib/datadog/profiling/collectors/thread_context.rb', line 29 def reset_after_fork self.class._native_reset_after_fork(self) end |