Search in sources :

Example 11 with Sampler

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

the class PercentRateSamplerTest method test_75p.

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

Example 12 with Sampler

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

the class PercentRateSamplerTest method test_1p.

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

Example 13 with Sampler

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

the class CountingSamplerFactoryTest method createSamplerSamplingRate_Negative.

@Test
public void createSamplerSamplingRate_Negative() {
    SamplerFactory factory = new CountingSamplerFactory(-1);
    Sampler sampler = factory.createSampler();
    boolean sampling = sampler.isSampling();
    Assert.assertFalse(sampling);
}
Also used : 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