Search in sources :

Example 1 with TraceSampler

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;
}
Also used : BasicTraceSampler(com.navercorp.pinpoint.profiler.sampler.BasicTraceSampler) TraceSampler(com.navercorp.pinpoint.bootstrap.sampler.TraceSampler) RateLimitTraceSampler(com.navercorp.pinpoint.profiler.sampler.RateLimitTraceSampler) RateLimitTraceSampler(com.navercorp.pinpoint.profiler.sampler.RateLimitTraceSampler) BasicTraceSampler(com.navercorp.pinpoint.profiler.sampler.BasicTraceSampler)

Example 2 with 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);
}
Also used : TraceSampler(com.navercorp.pinpoint.bootstrap.sampler.TraceSampler) Sampler(com.navercorp.pinpoint.bootstrap.sampler.Sampler) TraceSampler(com.navercorp.pinpoint.bootstrap.sampler.TraceSampler) IdGenerator(com.navercorp.pinpoint.profiler.context.id.IdGenerator) AtomicIdGenerator(com.navercorp.pinpoint.profiler.context.id.AtomicIdGenerator) AtomicIdGenerator(com.navercorp.pinpoint.profiler.context.id.AtomicIdGenerator)

Example 3 with TraceSampler

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());
}
Also used : TraceSampler(com.navercorp.pinpoint.bootstrap.sampler.TraceSampler) Test(org.junit.Test)

Example 4 with TraceSampler

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());
}
Also used : TraceSampler(com.navercorp.pinpoint.bootstrap.sampler.TraceSampler) Test(org.junit.Test)

Aggregations

TraceSampler (com.navercorp.pinpoint.bootstrap.sampler.TraceSampler)4 Test (org.junit.Test)2 Sampler (com.navercorp.pinpoint.bootstrap.sampler.Sampler)1 AtomicIdGenerator (com.navercorp.pinpoint.profiler.context.id.AtomicIdGenerator)1 IdGenerator (com.navercorp.pinpoint.profiler.context.id.IdGenerator)1 BasicTraceSampler (com.navercorp.pinpoint.profiler.sampler.BasicTraceSampler)1 RateLimitTraceSampler (com.navercorp.pinpoint.profiler.sampler.RateLimitTraceSampler)1