diff --git a/ext/datadog_profiling_native_extension/collectors_thread_context.c b/ext/datadog_profiling_native_extension/collectors_thread_context.c index 8704c42ecb..bb78763be6 100644 --- a/ext/datadog_profiling_native_extension/collectors_thread_context.c +++ b/ext/datadog_profiling_native_extension/collectors_thread_context.c @@ -231,7 +231,7 @@ static void ddtrace_otel_trace_identifiers_for( VALUE active_span, VALUE otel_values ); -static VALUE _native_sample_skipped_allocation_samples(DDTRACE_UNUSED VALUE self, VALUE collector_instance, VALUE missed_allocations); +static VALUE _native_sample_skipped_allocation_samples(DDTRACE_UNUSED VALUE self, VALUE collector_instance, VALUE skipped_samples); void collectors_thread_context_init(VALUE profiling_module) { VALUE collectors_module = rb_define_module_under(profiling_module, "Collectors"); @@ -1403,7 +1403,7 @@ static void ddtrace_otel_trace_identifiers_for( *numeric_span_id = resolved_numeric_span_id; } -void thread_context_collector_sample_skipped_allocation_samples(VALUE self_instance, unsigned int missed_allocations) { +void thread_context_collector_sample_skipped_allocation_samples(VALUE self_instance, unsigned int skipped_samples) { struct thread_context_collector_state *state; TypedData_Get_Struct(self_instance, struct thread_context_collector_state, &thread_context_collector_typed_data, state); @@ -1418,7 +1418,7 @@ void thread_context_collector_sample_skipped_allocation_samples(VALUE self_insta record_placeholder_stack( state->sampling_buffer, state->recorder_instance, - (sample_values) {.alloc_samples = missed_allocations}, + (sample_values) {.alloc_samples = skipped_samples}, (sample_labels) { .labels = slice_labels, .state_label = NULL, @@ -1428,7 +1428,7 @@ void thread_context_collector_sample_skipped_allocation_samples(VALUE self_insta ); } -static VALUE _native_sample_skipped_allocation_samples(DDTRACE_UNUSED VALUE self, VALUE collector_instance, VALUE missed_allocations) { - thread_context_collector_sample_skipped_allocation_samples(collector_instance, NUM2UINT(missed_allocations)); +static VALUE _native_sample_skipped_allocation_samples(DDTRACE_UNUSED VALUE self, VALUE collector_instance, VALUE skipped_samples) { + thread_context_collector_sample_skipped_allocation_samples(collector_instance, NUM2UINT(skipped_samples)); return Qtrue; } diff --git a/ext/datadog_profiling_native_extension/collectors_thread_context.h b/ext/datadog_profiling_native_extension/collectors_thread_context.h index 16e9405ca3..073c1caa91 100644 --- a/ext/datadog_profiling_native_extension/collectors_thread_context.h +++ b/ext/datadog_profiling_native_extension/collectors_thread_context.h @@ -9,7 +9,7 @@ void thread_context_collector_sample( VALUE profiler_overhead_stack_thread ); void thread_context_collector_sample_allocation(VALUE self_instance, unsigned int sample_weight, VALUE new_object); -void thread_context_collector_sample_skipped_allocation_samples(VALUE self_instance, unsigned int missed_allocations); +void thread_context_collector_sample_skipped_allocation_samples(VALUE self_instance, unsigned int skipped_samples); VALUE thread_context_collector_sample_after_gc(VALUE self_instance); void thread_context_collector_on_gc_start(VALUE self_instance); bool thread_context_collector_on_gc_finish(VALUE self_instance); diff --git a/spec/datadog/profiling/collectors/thread_context_spec.rb b/spec/datadog/profiling/collectors/thread_context_spec.rb index 09fc04e19b..67dd0bfa43 100644 --- a/spec/datadog/profiling/collectors/thread_context_spec.rb +++ b/spec/datadog/profiling/collectors/thread_context_spec.rb @@ -79,8 +79,8 @@ def sample_allocation(weight:, new_object: Object.new) described_class::Testing._native_sample_allocation(cpu_and_wall_time_collector, weight, new_object) end - def sample_skipped_allocation_samples(missed_allocations) - described_class::Testing._native_sample_skipped_allocation_samples(cpu_and_wall_time_collector, missed_allocations) + def sample_skipped_allocation_samples(skipped_samples) + described_class::Testing._native_sample_skipped_allocation_samples(cpu_and_wall_time_collector, skipped_samples) end def thread_list @@ -1225,11 +1225,11 @@ def self.otel_sdk_available? expect(single_sample.values).to include('alloc-samples': 123) end - it 'attributes the missed allocations to a "Skipped Samples" thread' do + it 'attributes the skipped samples to a "Skipped Samples" thread' do expect(single_sample.labels).to include('thread id': 'SA', 'thread name': 'Skipped Samples') end - it 'attributes the missed allocations to a "(Skipped Samples)" allocation class' do + it 'attributes the skipped samples to a "(Skipped Samples)" allocation class' do expect(single_sample.labels).to include('allocation class': '(Skipped Samples)') end