use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.
the class TracerTest method testWithBaggageRestrictionManager.
@Test
public void testWithBaggageRestrictionManager() {
tracer = new Tracer.Builder("TracerTestService", new InMemoryReporter(), new ConstSampler(true)).withMetrics(new Metrics(metricsFactory)).build();
Span span = (Span) tracer.buildSpan("some-operation").start();
final String key = "key";
tracer.setBaggage(span, key, "value");
assertEquals(1, metricsFactory.getCounter("jaeger:baggage_updates", "result=ok"));
}
use of com.uber.jaeger.metrics.Metrics 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.metrics.Metrics 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);
}
use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.
the class SpanTest method setUp.
@Before
public void setUp() {
metricsFactory = new InMemoryMetricsFactory();
reporter = new InMemoryReporter();
clock = mock(Clock.class);
metrics = new Metrics(metricsFactory);
tracer = new Tracer.Builder("SamplerTest", reporter, new ConstSampler(true)).withMetrics(metrics).withClock(clock).withBaggageRestrictionManager(new DefaultBaggageRestrictionManager()).withExpandExceptionLogs().build();
span = (Span) tracer.buildSpan("some-operation").start();
}
use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.
the class BaggageSetterTest method setUp.
@Before
public void setUp() throws Exception {
metricsFactory = new InMemoryMetricsFactory();
reporter = new InMemoryReporter();
metrics = new Metrics(metricsFactory);
mgr = mock(DefaultBaggageRestrictionManager.class);
setter = new BaggageSetter(mgr, metrics);
tracer = new Tracer.Builder(SERVICE, reporter, new ConstSampler(true)).withMetrics(metrics).build();
span = (Span) tracer.buildSpan("some-operation").startManual();
}
Aggregations