Class: Datadog::Tracing::Sampling::Sampler Abstract
- Inherits:
-
Object
- Object
- Datadog::Tracing::Sampling::Sampler
- Defined in:
- lib/datadog/tracing/sampling/sampler.rb
Overview
This class is abstract.
Interface for client-side trace sampling.
Direct Known Subclasses
Instance Method Summary collapse
-
#sample!(trace) ⇒ Boolean
Returns
trueif the provided trace should be kept. -
#sample_rate(trace) ⇒ Float?
The sampling rate, if this sampler has such concept.
Instance Method Details
#sample!(trace) ⇒ Boolean
Returns true if the provided trace should be kept. Otherwise, false.
This method may modify the trace, in case changes are necessary based on the sampling decision.
17 18 19 |
# File 'lib/datadog/tracing/sampling/sampler.rb', line 17 def sample!(trace) raise NotImplementedError, 'Samplers must implement the #sample! method' end |
#sample_rate(trace) ⇒ Float?
The sampling rate, if this sampler has such concept. Otherwise, nil.
26 27 28 |
# File 'lib/datadog/tracing/sampling/sampler.rb', line 26 def sample_rate(trace) raise NotImplementedError, 'Samplers must implement the #sample_rate method' end |