@Test public void instrumentTaggedAsyncFunction() { AsyncTestService asyncTestService = AtlasDbMetrics.instrumentWithTaggedMetrics( taggedMetrics, AsyncTestService.class, this.asyncTestService); List<ListenableFuture<String>> futures = fireOffTenAsyncPings(asyncTestService); Instant now = Instant.now(); MetricName metricName = MetricName.builder().safeName(ASYNC_PING_METRIC_NAME).build(); awaitMetricsToBeReported(futures, metricName); assertThat(Instant.now()) .as("in the event of scheduling issues, and despite having 10 concurrent futures, we complete " + "everything with 2*ttl") .isBefore(now.plus(ASYNC_DURATION_TTL.plus(ASYNC_DURATION_TTL))); assertAllAsyncPingMetricsAreAccuratelyRecorded(futures, metricName); }
public static <T, U extends T> T instrumentWithTaggedMetrics( TaggedMetricRegistry taggedMetrics, Class<T> serviceInterface, U service) { return Instrumentation.builder(serviceInterface, service) .withHandler(new TaggedMetricsInvocationEventHandler( taggedMetrics, MetricRegistry.name(serviceInterface))) .withPerformanceTraceLogging() .build(); }
AtlasDbMetrics { public static <T, U extends T> T instrumentWithTaggedMetrics( TaggedMetricRegistry taggedMetrics, Class<T> serviceInterface, U service) { return Instrumentation.builder(serviceInterface, service) .withHandler(new TaggedMetricsInvocationEventHandler( taggedMetrics, MetricRegistry.name(serviceInterface))) .withPerformanceTraceLogging() .build(); } }
AtlasDbMetrics { public static <T, U extends T> T instrumentWithTaggedMetrics( TaggedMetricRegistry taggedMetrics, Class<T> serviceInterface, U service) { return Instrumentation.builder(serviceInterface, service) .withHandler(new TaggedMetricsInvocationEventHandler( taggedMetrics, MetricRegistry.name(serviceInterface))) .withPerformanceTraceLogging() .build(); } private  AtlasDbMetrics(); }
AtlasDbMetrics { public static <T, U extends T> T instrumentWithTaggedMetrics( TaggedMetricRegistry taggedMetrics, Class<T> serviceInterface, U service) { return Instrumentation.builder(serviceInterface, service) .withHandler(new TaggedMetricsInvocationEventHandler( taggedMetrics, MetricRegistry.name(serviceInterface))) .withPerformanceTraceLogging() .build(); } private  AtlasDbMetrics(); static T instrumentTimed(
            MetricRegistry metricRegistry, Class<T> serviceInterface, U service); static T instrumentTimed(
            MetricRegistry metricRegistry, Class<T> serviceInterface, U service, String name); @Deprecated static T instrument(
            MetricRegistry metricRegistry, Class<T> serviceInterface, U service); @Deprecated static T instrument(
            MetricRegistry metricRegistry, Class<T> serviceInterface, U service, String name); static T instrumentWithTaggedMetrics(
            TaggedMetricRegistry taggedMetrics,
            Class<T> serviceInterface,
            U service); static T instrumentWithTaggedMetrics(
            TaggedMetricRegistry taggedMetrics,
            Class<T> serviceInterface,
            U service,
            Function<InvocationContext, Map<String, String>> tagFunction); static void registerCache(MetricRegistry metricRegistry, Cache<?, ?> cache, String metricsPrefix); }
AtlasDbMetrics { public static <T, U extends T> T instrumentWithTaggedMetrics( TaggedMetricRegistry taggedMetrics, Class<T> serviceInterface, U service) { return Instrumentation.builder(serviceInterface, service) .withHandler(new TaggedMetricsInvocationEventHandler( taggedMetrics, MetricRegistry.name(serviceInterface))) .withPerformanceTraceLogging() .build(); } private  AtlasDbMetrics(); static T instrumentTimed(
            MetricRegistry metricRegistry, Class<T> serviceInterface, U service); static T instrumentTimed(
            MetricRegistry metricRegistry, Class<T> serviceInterface, U service, String name); @Deprecated static T instrument(
            MetricRegistry metricRegistry, Class<T> serviceInterface, U service); @Deprecated static T instrument(
            MetricRegistry metricRegistry, Class<T> serviceInterface, U service, String name); static T instrumentWithTaggedMetrics(
            TaggedMetricRegistry taggedMetrics,
            Class<T> serviceInterface,
            U service); static T instrumentWithTaggedMetrics(
            TaggedMetricRegistry taggedMetrics,
            Class<T> serviceInterface,
            U service,
            Function<InvocationContext, Map<String, String>> tagFunction); static void registerCache(MetricRegistry metricRegistry, Cache<?, ?> cache, String metricsPrefix);  }