use of com.uber.jaeger.samplers.Sampler in project jaeger-client-java by jaegertracing.
the class JaegerRequestAndResponseInterceptorIntegrationTest method setUp.
@Before
public void setUp() {
mockServerClient.when(HttpRequest.request().withMethod("GET").withPath("/testing")).respond(HttpResponse.response().withStatusCode(200));
reporter = new InMemoryReporter();
Sampler sampler = new ConstSampler(true);
tracer = new Tracer.Builder("test_service", reporter, sampler).build();
parentSpan = (Span) tracer.buildSpan("parent_operation").startManual();
parentSpan.setBaggageItem(BAGGAGE_KEY, BAGGAGE_VALUE);
parentSpan.finish();
// Set up a parent span context
tracer.scopeManager().activate(parentSpan, false);
}
use of com.uber.jaeger.samplers.Sampler in project jaeger-client-java by jaegertracing.
the class TracerTest method testClose.
@Test
public void testClose() {
Reporter reporter = mock(Reporter.class);
Sampler sampler = mock(Sampler.class);
tracer = new Tracer.Builder("bonda", reporter, sampler).build();
tracer.close();
verify(reporter).close();
verify(sampler).close();
}
use of com.uber.jaeger.samplers.Sampler 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(serviceName, manager, initialSampler, metrics, 5000);
com.uber.jaeger.Tracer.Builder remoteTracerBuilder = new com.uber.jaeger.Tracer.Builder(serviceName, reporter, remoteSampler);
return remoteTracerBuilder.build();
}
use of com.uber.jaeger.samplers.Sampler 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.samplers.Sampler 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