use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.
the class RemoteReporterTest method setUp.
@Before
public void setUp() throws Exception {
metricsFactory = new InMemoryMetricsFactory();
metrics = new Metrics(metricsFactory);
sender = new InMemorySender();
reporter = new RemoteReporter.Builder().withSender(sender).withFlushInterval(flushInterval).withMaxQueueSize(maxQueueSize).withMetrics(metrics).build();
tracer = new Tracer.Builder("test-remote-reporter", reporter, new ConstSampler(true)).withMetrics(metrics).build();
}
use of com.uber.jaeger.metrics.Metrics in project jaeger-client-java by jaegertracing.
the class Configuration method getTracerBuilder.
public Tracer.Builder getTracerBuilder() {
if (reporterConfig == null) {
reporterConfig = new ReporterConfiguration();
}
if (samplerConfig == null) {
samplerConfig = new SamplerConfiguration();
}
if (codecConfig == null) {
codecConfig = new CodecConfiguration(Collections.<Format<?>, List<Codec<TextMap>>>emptyMap());
}
if (metricsFactory == null) {
metricsFactory = new NoopMetricsFactory();
}
Metrics metrics = new Metrics(metricsFactory);
Reporter reporter = reporterConfig.getReporter(metrics);
Sampler sampler = samplerConfig.createSampler(serviceName, metrics);
Tracer.Builder builder = new Tracer.Builder(serviceName).withSampler(sampler).withReporter(reporter).withMetrics(metrics).withTags(tracerTags);
codecConfig.apply(builder);
return builder;
}
use of com.uber.jaeger.metrics.Metrics 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 StatsFactoryImpl(new NullStatsReporter())));
assertTrue(sampler instanceof ProbabilisticSampler);
}
Aggregations