Search in sources :

Example 6 with InMemoryMetricsFactory

use of io.jaegertracing.internal.metrics.InMemoryMetricsFactory 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);
}
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) ProbabilisticSampler(io.jaegertracing.internal.samplers.ProbabilisticSampler) Test(org.junit.Test)

Example 7 with InMemoryMetricsFactory

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

the class ConfigurationTest method testMetrics.

@Test
public void testMetrics() {
    InMemoryMetricsFactory inMemoryMetricsFactory = new InMemoryMetricsFactory();
    Configuration configuration = new Configuration("foo").withMetricsFactory(inMemoryMetricsFactory);
    assertEquals(inMemoryMetricsFactory, configuration.getMetricsFactory());
}
Also used : InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) SenderConfiguration(io.jaegertracing.Configuration.SenderConfiguration) CodecConfiguration(io.jaegertracing.Configuration.CodecConfiguration) ReporterConfiguration(io.jaegertracing.Configuration.ReporterConfiguration) SamplerConfiguration(io.jaegertracing.Configuration.SamplerConfiguration) Test(org.junit.Test)

Example 8 with InMemoryMetricsFactory

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

Example 9 with InMemoryMetricsFactory

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

the class UdpSenderTest method setUp.

@Before
public void setUp() throws Exception {
    server = startServer();
    reporter = new InMemoryReporter();
    final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder(SERVICE_NAME).withReporter(reporter).withSampler(new ConstSampler(true)).withMetricsFactory(new InMemoryMetricsFactory()).withTag("foo", "bar");
    tracer = tracerBuilder.build();
    tracer128 = tracerBuilder.withTraceId128Bit().build();
    sender = new UdpSender(destHost, destPort, maxPacketSize);
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) JaegerTracer(io.jaegertracing.internal.JaegerTracer) Before(org.junit.Before)

Example 10 with InMemoryMetricsFactory

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

the class ZipkinSenderTest method setUp.

@Before
public void setUp() {
    reporter = new InMemoryReporter();
    final JaegerTracer.Builder tracerBuilder = new JaegerTracer.Builder("test-sender").withReporter(reporter).withSampler(new ConstSampler(true)).withMetricsFactory(new InMemoryMetricsFactory());
    tracer = tracerBuilder.build();
    tracer128 = tracerBuilder.withTraceId128Bit().build();
    sender = newSender(messageMaxBytes);
    converter = new ThriftSpanConverter();
}
Also used : InMemoryReporter(io.jaegertracing.internal.reporters.InMemoryReporter) InMemoryMetricsFactory(io.jaegertracing.internal.metrics.InMemoryMetricsFactory) ConstSampler(io.jaegertracing.internal.samplers.ConstSampler) ThriftSpanConverter(io.jaegertracing.zipkin.internal.ThriftSpanConverter) 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