Search in sources :

Example 1 with InMemoryMetricsFactory

use of io.jaegertracing.internal.metrics.InMemoryMetricsFactory 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 InMemoryMetricsFactory()));
    assertTrue(sampler instanceof ConstSampler);
}
Also used : Metrics(io.jaegertracing.internal.metrics.Metrics) InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) Sampler(io.jaegertracing.spi.Sampler) RateLimitingSampler(io.jaegertracing.internal.samplers.RateLimitingSampler) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) ProbabilisticSampler(io.jaegertracing.internal.samplers.ProbabilisticSampler) SamplerConfiguration(io.jaegertracing.Configuration.SamplerConfiguration) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) Test(org.junit.Test)

Example 2 with InMemoryMetricsFactory

use of io.jaegertracing.internal.metrics.InMemoryMetricsFactory in project jaeger-client-java by jaegertracing.

the class RemoteBaggageRestrictionManagerTest method setUp.

@Before
public void setUp() throws Exception {
    metricsFactory = new InMemoryMetricsFactory();
    metrics = new Metrics(metricsFactory);
}
Also used : InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) Metrics(io.jaegertracing.internal.metrics.Metrics) Before(org.junit.Before)

Example 3 with InMemoryMetricsFactory

use of io.jaegertracing.internal.metrics.InMemoryMetricsFactory in project jaeger-client-java by jaegertracing.

the class RemoteControlledSamplerTest method setUp.

@Before
public void setUp() throws Exception {
    metrics = new Metrics(new InMemoryMetricsFactory());
    // TODO this starts the timer with mocks not yet configured, causing NPEs; refactor to .build() from tests
    undertest = new RemoteControlledSampler.Builder(SERVICE_NAME).withSamplingManager(samplingManager).withInitialSampler(initialSampler).withMetrics(metrics).build();
}
Also used : Metrics(io.jaegertracing.internal.metrics.Metrics) InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) Before(org.junit.Before)

Example 4 with InMemoryMetricsFactory

use of io.jaegertracing.internal.metrics.InMemoryMetricsFactory in project jaeger-client-java by jaegertracing.

the class JaegerSpanTest method setUp.

@Before
public void setUp() {
    metricsFactory = new InMemoryMetricsFactory();
    reporter = new InMemoryReporter();
    clock = mock(Clock.class);
    metrics = new Metrics(metricsFactory);
    final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder("SamplerTest").withReporter(reporter).withSampler(new ConstSampler(true)).withMetrics(metrics).withClock(clock).withBaggageRestrictionManager(new DefaultBaggageRestrictionManager()).withExpandExceptionLogs();
    tracer = tracerBuilder.build();
    tracer128 = tracerBuilder.withTraceId128Bit().build();
    jaegerSpan = tracer.buildSpan("some-operation").start();
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) Metrics(io.jaegertracing.internal.metrics.Metrics) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) Clock(io.jaegertracing.internal.clock.Clock) DefaultBaggageRestrictionManager(io.jaegertracing.internal.baggage.DefaultBaggageRestrictionManager) Before(org.junit.Before)

Example 5 with InMemoryMetricsFactory

use of io.jaegertracing.internal.metrics.InMemoryMetricsFactory in project jaeger-client-java by jaegertracing.

the class ZipkinV2ReporterTest method setup.

@Before
public void setup() {
    sender = URLConnectionSender.newBuilder().encoding(Encoding.JSON).endpoint(zipkinRule.httpUrl() + "/api/v2/spans").build();
    zipkinReporter = zipkin2.reporter.AsyncReporter.builder(sender).messageTimeout(0, TimeUnit.MILLISECONDS).build();
    reporter = new ZipkinV2Reporter(zipkinReporter);
    tracer = new JaegerTracer.Builder("test-sender").withReporter(reporter).withSampler(new ConstSampler(true)).withMetricsFactory(new InMemoryMetricsFactory()).build();
}
Also used : InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) ZipkinV2Reporter(io.jaegertracing.zipkin.ZipkinV2Reporter) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) JaegerTracer(io.jaegertracing.internal.JaegerTracer) Before(org.junit.Before)

Aggregations

InMemoryMetricsFactory (io.jaegertracing.internal.metrics.InMemoryMetricsFactory)14 ConstSampler (io.jaegertracing.internal.samplers.ConstSampler)11 Metrics (io.jaegertracing.internal.metrics.Metrics)10 Before (org.junit.Before)9 InMemoryReporter (io.jaegertracing.internal.reporters.InMemoryReporter)6 JaegerTracer (io.jaegertracing.internal.JaegerTracer)5 Test (org.junit.Test)5 SamplerConfiguration (io.jaegertracing.Configuration.SamplerConfiguration)4 ProbabilisticSampler (io.jaegertracing.internal.samplers.ProbabilisticSampler)3 RateLimitingSampler (io.jaegertracing.internal.samplers.RateLimitingSampler)3 Sampler (io.jaegertracing.spi.Sampler)3 Builder (io.jaegertracing.internal.JaegerTracer.Builder)2 CodecConfiguration (io.jaegertracing.Configuration.CodecConfiguration)1 ReporterConfiguration (io.jaegertracing.Configuration.ReporterConfiguration)1 SenderConfiguration (io.jaegertracing.Configuration.SenderConfiguration)1 DefaultBaggageRestrictionManager (io.jaegertracing.internal.baggage.DefaultBaggageRestrictionManager)1 Clock (io.jaegertracing.internal.clock.Clock)1 Builder (io.jaegertracing.internal.reporters.RemoteReporter.Builder)1 InMemorySender (io.jaegertracing.internal.senders.InMemorySender)1 ZipkinV2Reporter (io.jaegertracing.zipkin.ZipkinV2Reporter)1