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?(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.
29 30 31 |
# File 'lib/datadog/tracing/sampling/sampler.rb', line 29 def sample!(trace) raise NotImplementedError, 'Samplers must implement the #sample! method' end |
#sample?(trace) ⇒ Boolean
Returns true if the provided trace should be kept.
Otherwise, false.
This method must not modify the trace.
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.
38 39 40 |
# File 'lib/datadog/tracing/sampling/sampler.rb', line 38 def sample_rate(trace) raise NotImplementedError, 'Samplers must implement the #sample_rate method' end |