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 ‘true` if the provided trace should be kept.
-
#sample?(trace) ⇒ Boolean
Returns ‘true` if 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.
27 28 29 |
# File 'lib/datadog/tracing/sampling/sampler.rb', line 27 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`.
15 16 17 |
# File 'lib/datadog/tracing/sampling/sampler.rb', line 15 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`.
36 37 38 |
# File 'lib/datadog/tracing/sampling/sampler.rb', line 36 def sample_rate(trace) raise NotImplementedError, 'Samplers must implement the #sample_rate method' end |