Search in sources :

Example 6 with Sampler

use of com.navercorp.pinpoint.bootstrap.sampler.Sampler in project pinpoint by naver.

the class PercentRateSamplerTest method test_33p.

@Test
public void test_33p() {
    // 30% = 30.03030303....
    Sampler sampler = new PercentRateSampler(33_00);
    for (int i = 0; i < 33; i++) {
        assertChoice(sampler);
        assertDrop(sampler);
        assertDrop(sampler);
    }
    assertDrop(sampler);
    assertChoice(sampler);
    assertDrop(sampler);
}
Also used : Sampler(com.navercorp.pinpoint.bootstrap.sampler.Sampler) Test(org.junit.Test)

Example 7 with Sampler

use of com.navercorp.pinpoint.bootstrap.sampler.Sampler in project pinpoint by naver.

the class PercentRateSamplerTest method test_10p.

@Test
public void test_10p() {
    Sampler sampler = new PercentRateSampler(10_00);
    assertChoice(sampler);
    for (int i = 0; i < 9; i++) {
        assertDrop(sampler);
    }
    assertChoice(sampler);
}
Also used : Sampler(com.navercorp.pinpoint.bootstrap.sampler.Sampler) Test(org.junit.Test)

Example 8 with Sampler

use of com.navercorp.pinpoint.bootstrap.sampler.Sampler in project pinpoint by naver.

the class PercentRateSamplerTest method test_25p.

@Test
public void test_25p() {
    Sampler sampler = new PercentRateSampler(25_00);
    assertChoice(sampler);
    assertDrop(sampler);
    assertDrop(sampler);
    assertDrop(sampler);
}
Also used : Sampler(com.navercorp.pinpoint.bootstrap.sampler.Sampler) Test(org.junit.Test)

Example 9 with Sampler

use of com.navercorp.pinpoint.bootstrap.sampler.Sampler 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 10 with Sampler

use of com.navercorp.pinpoint.bootstrap.sampler.Sampler in project pinpoint by naver.

the class SamplerFactoryTest method createSamplerSamplingRate0.

@Test
public void createSamplerSamplingRate0() {
    SamplerFactory samplerFactory = new SamplerFactory();
    Sampler sampler = samplerFactory.createSampler(true, 0);
    boolean sampling = sampler.isSampling();
    Assert.assertFalse(sampling);
}
Also used : SamplerFactory(com.navercorp.pinpoint.profiler.sampler.SamplerFactory) Sampler(com.navercorp.pinpoint.bootstrap.sampler.Sampler) Test(org.junit.Test)

Aggregations

Sampler (com.navercorp.pinpoint.bootstrap.sampler.Sampler)13 Test (org.junit.Test)12 SamplerFactory (com.navercorp.pinpoint.profiler.sampler.SamplerFactory)2 TraceSampler (com.navercorp.pinpoint.bootstrap.sampler.TraceSampler)1 AtomicIdGenerator (com.navercorp.pinpoint.profiler.context.id.AtomicIdGenerator)1 IdGenerator (com.navercorp.pinpoint.profiler.context.id.IdGenerator)1