Sha256: 2c22a806a1e808e34f7b8ee83a6e62916c4a4cc4a69e8b2408861f56bf5f3e71

Contents?: true

Size: 665 Bytes

Versions: 18

Compression:

Stored size: 665 Bytes

Contents

#pragma once

#include <stdatomic.h>
#include <stdbool.h>

typedef struct {
  atomic_long next_sample_after_monotonic_wall_time_ns;
} dynamic_sampling_rate_state;

void dynamic_sampling_rate_init(dynamic_sampling_rate_state *state);
void dynamic_sampling_rate_reset(dynamic_sampling_rate_state *state);
uint64_t dynamic_sampling_rate_get_sleep(dynamic_sampling_rate_state *state, long current_monotonic_wall_time_ns);
bool dynamic_sampling_rate_should_sample(dynamic_sampling_rate_state *state, long wall_time_ns_before_sample);
void dynamic_sampling_rate_after_sample(dynamic_sampling_rate_state *state, long wall_time_ns_after_sample, uint64_t sampling_time_ns);

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ddtrace-1.18.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.17.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.16.2 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.16.1 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.16.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.15.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.14.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.13.1 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.13.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.12.1 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.12.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.11.1 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.11.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.11.0.beta1 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.10.1 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.10.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.9.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h
ddtrace-1.8.0 ext/ddtrace_profiling_native_extension/collectors_dynamic_sampling_rate.h