use of io.jaegertracing.internal.samplers.ProbabilisticSampler in project jaeger-client-java by jaegertracing.
the class EndToEndBehavior method getRemoteTracer.
private Tracer getRemoteTracer(Metrics metrics, Reporter reporter, String serviceName, String samplingHostPort) {
Sampler initialSampler = new ProbabilisticSampler(1.0);
HttpSamplingManager manager = new HttpSamplingManager(samplingHostPort);
RemoteControlledSampler remoteSampler = new RemoteControlledSampler.Builder(serviceName).withSamplingManager(manager).withInitialSampler(initialSampler).withMetrics(metrics).withPollingInterval(5000).build();
return new JaegerTracer.Builder(serviceName).withReporter(reporter).withSampler(remoteSampler).build();
}
use of io.jaegertracing.internal.samplers.ProbabilisticSampler in project jaeger-client-java by jaegertracing.
the class ConfigurationTest method testProbabilisticSampler.
@Test
public void testProbabilisticSampler() {
SamplerConfiguration samplerConfiguration = new SamplerConfiguration().withType(ProbabilisticSampler.TYPE);
Sampler sampler = samplerConfiguration.createSampler("name", new Metrics(new InMemoryMetricsFactory()));
assertTrue(sampler instanceof ProbabilisticSampler);
}
Aggregations