use of com.uber.jaeger.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testSamplerConst.
@Test
public void testSamplerConst() {
System.setProperty(Configuration.JAEGER_SAMPLER_TYPE, ConstSampler.TYPE);
System.setProperty(Configuration.JAEGER_SAMPLER_PARAM, "1");
SamplerConfiguration samplerConfig = SamplerConfiguration.fromEnv();
assertEquals(ConstSampler.TYPE, samplerConfig.getType());
assertEquals(1, samplerConfig.getParam().intValue());
}
use of com.uber.jaeger.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testUnknownSampler.
@Test(expected = IllegalStateException.class)
public void testUnknownSampler() {
SamplerConfiguration samplerConfiguration = new SamplerConfiguration();
samplerConfiguration.withType("unknown");
new Configuration("name").withSampler(samplerConfiguration).getTracer();
}
use of com.uber.jaeger.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testSamplerConstInvalidParam.
@Test
public void testSamplerConstInvalidParam() {
System.setProperty(Configuration.JAEGER_SAMPLER_TYPE, ConstSampler.TYPE);
System.setProperty(Configuration.JAEGER_SAMPLER_PARAM, "X");
SamplerConfiguration samplerConfig = SamplerConfiguration.fromEnv();
assertEquals(ConstSampler.TYPE, samplerConfig.getType());
assertNull(samplerConfig.getParam());
}
use of com.uber.jaeger.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testRateLimitingSampler.
@Test
public void testRateLimitingSampler() {
SamplerConfiguration samplerConfiguration = new SamplerConfiguration().withType(RateLimitingSampler.TYPE);
Sampler sampler = samplerConfiguration.createSampler("name", new Metrics(new StatsFactoryImpl(new NullStatsReporter())));
assertTrue(sampler instanceof RateLimitingSampler);
}
use of com.uber.jaeger.Configuration.SamplerConfiguration in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testConstSampler.
@Test
public void testConstSampler() {
SamplerConfiguration samplerConfiguration = new SamplerConfiguration().withType(ConstSampler.TYPE);
Sampler sampler = samplerConfiguration.createSampler("name", new Metrics(new StatsFactoryImpl(new NullStatsReporter())));
assertTrue(sampler instanceof ConstSampler);
}
Aggregations