Package io.opencensus.trace.samplers
Class Samplers
java.lang.Object
io.opencensus.trace.samplers.Samplers
Static class to access a set of pre-defined
Samplers
.- Since:
- 0.5
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Sampler
static Sampler
static Sampler
probabilitySampler
(double probability) Returns aSampler
that makes a "yes" decision with a given probability.
-
Field Details
-
ALWAYS_SAMPLE
-
NEVER_SAMPLE
-
-
Constructor Details
-
Samplers
private Samplers()
-
-
Method Details
-
alwaysSample
- Returns:
- a
Sampler
that always makes a "yes" decision onSpan
sampling. - Since:
- 0.5
-
neverSample
- Returns:
- a
Sampler
that always makes a "no" decision onSpan
sampling. - Since:
- 0.5
-
probabilitySampler
Returns aSampler
that makes a "yes" decision with a given probability.- Parameters:
probability
- The desired probability of sampling. Must be within [0.0, 1.0].- Returns:
- a
Sampler
that makes a "yes" decision with a given probability. - Throws:
IllegalArgumentException
- ifprobability
is out of range- Since:
- 0.5
-