TraceSampler<String>
public class DeterministicTraceSampler extends Object implements TraceSampler<String>
- A sample rate of 0 means the TraceSampler will never sample.
- A sampler rate of 1 means it will always samples.
This implementation is based on the implementations (and necessarily needs to be in line with) the other Beeline implementations.
Constructor | Description |
---|---|
DeterministicTraceSampler(int sampleRate) |
See the class level javadoc for an explanation of the sampleRate.
|
Modifier and Type | Method | Description |
---|---|---|
int |
sample(String traceId) |
Decides, based on the given traceId, whether to sample the current trace.
|
public DeterministicTraceSampler(int sampleRate)
sampleRate
- to use - must not be negative.IllegalArgumentException
- if sampleRate is negative.IllegalStateException
- if SHA-1 is not supported.public int sample(String traceId)
sampleRate
.sample
in interface TraceSampler<String>
traceId
- to use as input to the sampling algorithm.Copyright © 2019–2020 Honeycomb. All rights reserved.