@Test public void shouldRecordSuccesses() { TimeLimiter timeLimiter = TimeLimiter.of(TimeLimiterConfig.ofDefaults()); metricRegistry.registerAll(TimeLimiterMetrics.ofTimeLimiter(timeLimiter)); timeLimiter.onSuccess(); timeLimiter.onSuccess(); assertThat(metricRegistry).hasMetricsSize(3); assertThat(metricRegistry).counter(DEFAULT_PREFIX + SUCCESSFUL) .hasValue(2L); assertThat(metricRegistry).counter(DEFAULT_PREFIX + FAILED) .hasValue(0L); assertThat(metricRegistry).counter(DEFAULT_PREFIX + TIMEOUT) .hasValue(0L); }
public static TimeLimiterMetrics ofTimeLimiter(TimeLimiter timeLimiter) { return new TimeLimiterMetrics(Array.of(timeLimiter)); }
TimeLimiterMetrics implements MetricSet { public static TimeLimiterMetrics ofTimeLimiter(TimeLimiter timeLimiter) { return new TimeLimiterMetrics(Array.of(timeLimiter)); } }
TimeLimiterMetrics implements MetricSet { public static TimeLimiterMetrics ofTimeLimiter(TimeLimiter timeLimiter) { return new TimeLimiterMetrics(Array.of(timeLimiter)); } private  TimeLimiterMetrics(Iterable<TimeLimiter> timeLimiters); private  TimeLimiterMetrics(String prefix, Iterable<TimeLimiter> timeLimiters,
        MetricRegistry metricRegistry); }
TimeLimiterMetrics implements MetricSet { public static TimeLimiterMetrics ofTimeLimiter(TimeLimiter timeLimiter) { return new TimeLimiterMetrics(Array.of(timeLimiter)); } private  TimeLimiterMetrics(Iterable<TimeLimiter> timeLimiters); private  TimeLimiterMetrics(String prefix, Iterable<TimeLimiter> timeLimiters,
        MetricRegistry metricRegistry); static TimeLimiterMetrics ofTimeLimiterRegistry(String prefix,
        TimeLimiterRegistry timeLimiterRegistry, MetricRegistry metricRegistry); static TimeLimiterMetrics ofTimeLimiterRegistry(String prefix,
        TimeLimiterRegistry timeLimiterRegistry); static TimeLimiterMetrics ofTimeLimiterRegistry(TimeLimiterRegistry timeLimiterRegistry,
        MetricRegistry metricRegistry); static TimeLimiterMetrics ofTimeLimiterRegistry(
        TimeLimiterRegistry timeLimiterRegistry); static TimeLimiterMetrics ofIterable(Iterable<TimeLimiter> timeLimiters); static TimeLimiterMetrics ofIterable(String prefix, Iterable<TimeLimiter> timeLimiters); static TimeLimiterMetrics ofTimeLimiter(TimeLimiter timeLimiter); @Override Map<String, Metric> getMetrics(); }
TimeLimiterMetrics implements MetricSet { public static TimeLimiterMetrics ofTimeLimiter(TimeLimiter timeLimiter) { return new TimeLimiterMetrics(Array.of(timeLimiter)); } private  TimeLimiterMetrics(Iterable<TimeLimiter> timeLimiters); private  TimeLimiterMetrics(String prefix, Iterable<TimeLimiter> timeLimiters,
        MetricRegistry metricRegistry); static TimeLimiterMetrics ofTimeLimiterRegistry(String prefix,
        TimeLimiterRegistry timeLimiterRegistry, MetricRegistry metricRegistry); static TimeLimiterMetrics ofTimeLimiterRegistry(String prefix,
        TimeLimiterRegistry timeLimiterRegistry); static TimeLimiterMetrics ofTimeLimiterRegistry(TimeLimiterRegistry timeLimiterRegistry,
        MetricRegistry metricRegistry); static TimeLimiterMetrics ofTimeLimiterRegistry(
        TimeLimiterRegistry timeLimiterRegistry); static TimeLimiterMetrics ofIterable(Iterable<TimeLimiter> timeLimiters); static TimeLimiterMetrics ofIterable(String prefix, Iterable<TimeLimiter> timeLimiters); static TimeLimiterMetrics ofTimeLimiter(TimeLimiter timeLimiter); @Override Map<String, Metric> getMetrics();  }