Search in sources :

Example 1 with Sampler

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

the class SamplerFactoryTest method createSamplerSamplingRate_Negative.

@Test
public void createSamplerSamplingRate_Negative() {
    SamplerFactory samplerFactory = new SamplerFactory();
    Sampler sampler = samplerFactory.createSampler(true, -1);
    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)

Example 2 with Sampler

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

the class CountingSamplerFactoryTest method sampling.

@Test
public void sampling() {
    SamplerFactory factory = new CountingSamplerFactory(2);
    Sampler sampler = factory.createSampler();
    Assert.assertEquals(true, sampler.isSampling());
    Assert.assertEquals(false, sampler.isSampling());
    Assert.assertEquals(true, sampler.isSampling());
    Assert.assertEquals(false, sampler.isSampling());
}
Also used : Sampler(com.navercorp.pinpoint.bootstrap.sampler.Sampler) Test(org.junit.Test)

Example 3 with Sampler

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

the class CountingSamplerFactoryTest method createSamplerSamplingRate0.

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

Example 4 with Sampler

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

the class PercentSamplerFactoryTest method isSampling.

@Test
public void isSampling() {
    SamplerFactory factory = new PercentSamplerFactory(50_00);
    Sampler sampler = factory.createSampler();
    Assert.assertEquals(true, sampler.isSampling());
    Assert.assertEquals(false, sampler.isSampling());
    Assert.assertEquals(true, sampler.isSampling());
    Assert.assertEquals(false, sampler.isSampling());
}
Also used : Sampler(com.navercorp.pinpoint.bootstrap.sampler.Sampler) Test(org.junit.Test)

Example 5 with Sampler

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

the class PercentRateSamplerTest method test_50p.

@Test
public void test_50p() {
    Sampler sampler = new PercentRateSampler(50_00);
    assertChoice(sampler);
    assertDrop(sampler);
    assertChoice(sampler);
    assertDrop(sampler);
}
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