use of com.navercorp.pinpoint.profiler.sampler.SamplerFactory 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);
}
use of com.navercorp.pinpoint.profiler.sampler.SamplerFactory in project pinpoint by naver.
the class SamplerProvider method get.
@Override
public Sampler get() {
boolean samplingEnable = profilerConfig.isSamplingEnable();
int samplingRate = profilerConfig.getSamplingRate();
SamplerFactory samplerFactory = new SamplerFactory();
return samplerFactory.createSampler(samplingEnable, samplingRate);
}
use of com.navercorp.pinpoint.profiler.sampler.SamplerFactory in project pinpoint by naver.
the class SamplerProvider method get.
@Override
public Sampler get() {
SamplerConfig config = new SamplerConfig(profilerConfig);
logger.info("SamplerConfig:{}", config);
if (!config.isSamplingEnable()) {
return FalseSampler.INSTANCE;
}
SamplerType samplerType = config.getSamplerType();
SamplerFactory samplerFactory = newSamplerFactory(samplerType, profilerConfig);
return samplerFactory.createSampler();
}
use of com.navercorp.pinpoint.profiler.sampler.SamplerFactory 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);
}
Aggregations