public class RateSampler extends Object implements Sampler
| Constructor and Description |
|---|
RateSampler(double samplingRate)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isEarly()
Whether this sampler performs early or head based sampling.
|
static boolean |
sample(double samplingRate,
long traceId)
Gets whether a span should be allowed given it's sampling rate and trace id.
|
boolean |
sample(String operationName,
long traceId,
long duration)
Gets whether a span should be allowed given it's operation and trace id.
|
void |
setSamplingRate(double samplingRate)
Sets the sampling rate for this sampler.
|
public RateSampler(double samplingRate)
samplingRate - a sampling rate between 0.0 and 1.0.public boolean sample(String operationName, long traceId, long duration)
Samplerpublic static boolean sample(double samplingRate,
long traceId)
samplingRate - The sampling rate between 0.0 and 1.0. of the spantraceId - The traceId of the spanpublic boolean isEarly()
Samplerpublic void setSamplingRate(double samplingRate)
samplingRate - the sampling rate between 0.0 and 1.0Copyright © 2020. All rights reserved.