public class Sampler extends Object
移植 Twitter Common, 优化使用ThreadLocalRandom
https://github.com/twitter/commons/blob/master/src/java/com/twitter/common/util/Sampler.java
| 限定符和类型 | 类和说明 |
|---|---|
protected static class |
Sampler.AlwaysSampler
采样率为100时,总是返回true
|
protected static class |
Sampler.NeverSampler
采样率为0时,总是返回false
|
Copyright © 2019. All rights reserved.