use of io.jaegertracing.internal.metrics.Timer in project jaeger-client-java by jaegertracing.
the class MicrometerTest method testTimer.
@Test
public void testTimer() {
// we have no timers on the Metrics class yet, so, we simulate one
Map<String, String> tags = new HashMap<>(1);
tags.put("akey", "avalue");
Timer timer = new MicrometerMetricsFactory().createTimer("jaeger_tracer_timed_operation", tags);
timer.durationMicros(100);
assertThat(registry.get("jaeger_tracer_timed_operation").timer().totalTime(TimeUnit.MICROSECONDS), IsEqual.equalTo(100d));
assertTrue(prometheusRegistry.scrape().contains("jaeger_tracer_timed_operation_seconds"));
}