use of com.navercorp.pinpoint.bootstrap.sampler.TraceSampler in project pinpoint by naver.
the class TraceSamplerProvider method get.
@Override
public TraceSampler get() {
logger.info("new BasicTraceSampler()");
TraceSampler traceSampler = new BasicTraceSampler(idGenerator, sampler);
final int samplingNewThroughput = contextConfig.getSamplingNewThroughput();
final int samplingContinueThroughput = contextConfig.getSamplingContinueThroughput();
if (samplingNewThroughput > 0 || samplingContinueThroughput > 0) {
traceSampler = new RateLimitTraceSampler(samplingNewThroughput, samplingContinueThroughput, idGenerator, traceSampler);
logger.info("new RateLimitTraceSampler {}/{}", samplingNewThroughput, samplingContinueThroughput);
}
return traceSampler;
}
use of com.navercorp.pinpoint.bootstrap.sampler.TraceSampler in project pinpoint by naver.
the class ThroughputSamplerTest method newTraceSampler.
private TraceSampler newTraceSampler(int throughput) {
IdGenerator atomicIdGenerator = new AtomicIdGenerator();
Sampler trueSampler = TrueSampler.INSTANCE;
TraceSampler basicSampler = new BasicTraceSampler(atomicIdGenerator, trueSampler);
return new RateLimitTraceSampler(throughput, 0, atomicIdGenerator, basicSampler);
}
use of com.navercorp.pinpoint.bootstrap.sampler.TraceSampler in project pinpoint by naver.
the class ThroughputSamplerTest method isSampling_1000.
@Test
public void isSampling_1000() {
// 1000 per seconds
TraceSampler sampler = newTraceSampler(1000);
Assert.assertTrue(sampler.isNewSampled().isSampled());
}
use of com.navercorp.pinpoint.bootstrap.sampler.TraceSampler in project pinpoint by naver.
the class ThroughputSamplerTest method isSampling_1.
@Test
public void isSampling_1() {
// 1 per seconds
TraceSampler sampler = newTraceSampler(1);
Assert.assertTrue(sampler.isNewSampled().isSampled());
}
Aggregations