public final class CountingSampler extends Sampler
This initializes a random bitset of size 100 (corresponding to 1% granularity). This means that it is accurate in units of 100 traces. At runtime, this loops through the bitset, returning the value according to a counter.
ALWAYS_SAMPLE, NEVER_SAMPLE
Modifier and Type | Method | Description |
---|---|---|
static Sampler |
create(float rate) |
|
boolean |
isSampled(long traceIdIgnored) |
loops over the pre-canned decisions, resetting to zero when it gets to the end.
|
String |
toString() |
public static Sampler create(float rate)
rate
- 0 means never sample, 1 means always sample. Otherwise minimum sample rate is 0.01,
or 1% of tracespublic boolean isSampled(long traceIdIgnored)
Copyright © 2018 OpenZipkin. All rights reserved.