@Test public void customMetricNamesOverrideDefaultOnes() { TimeLimiterMetricsCollector.MetricNames names = TimeLimiterMetricsCollector.MetricNames .custom() .callsMetricName("custom_calls") .build(); CollectorRegistry customRegistry = new CollectorRegistry(); TimeLimiterMetricsCollector.ofTimeLimiterRegistry(names, timeLimiterRegistry) .register(customRegistry); timeLimiter.onSuccess(); timeLimiter.onError(new RuntimeException()); timeLimiter.onError(new TimeoutException()); Double successfulCalls = getSampleValue(customRegistry, "custom_calls", KIND_SUCCESSFUL); Double failedCalls = getSampleValue(customRegistry, "custom_calls", KIND_FAILED); Double timeoutCalls = getSampleValue(customRegistry, "custom_calls", KIND_TIMEOUT); assertThat(successfulCalls).isNotNull(); assertThat(failedCalls).isNotNull(); assertThat(timeoutCalls).isNotNull(); }
public static TimeLimiterMetricsCollector ofTimeLimiterRegistry(MetricNames names, TimeLimiterRegistry timeLimiterRegistry) { return new TimeLimiterMetricsCollector(names, timeLimiterRegistry); }
TimeLimiterMetricsCollector extends AbstractTimeLimiterMetrics { public static TimeLimiterMetricsCollector ofTimeLimiterRegistry(MetricNames names, TimeLimiterRegistry timeLimiterRegistry) { return new TimeLimiterMetricsCollector(names, timeLimiterRegistry); } }
TimeLimiterMetricsCollector extends AbstractTimeLimiterMetrics { public static TimeLimiterMetricsCollector ofTimeLimiterRegistry(MetricNames names, TimeLimiterRegistry timeLimiterRegistry) { return new TimeLimiterMetricsCollector(names, timeLimiterRegistry); } private  TimeLimiterMetricsCollector(MetricNames names,
        TimeLimiterRegistry timeLimiterRegistry); }
TimeLimiterMetricsCollector extends AbstractTimeLimiterMetrics { public static TimeLimiterMetricsCollector ofTimeLimiterRegistry(MetricNames names, TimeLimiterRegistry timeLimiterRegistry) { return new TimeLimiterMetricsCollector(names, timeLimiterRegistry); } private  TimeLimiterMetricsCollector(MetricNames names,
        TimeLimiterRegistry timeLimiterRegistry); static TimeLimiterMetricsCollector ofTimeLimiterRegistry(MetricNames names,
        TimeLimiterRegistry timeLimiterRegistry); static TimeLimiterMetricsCollector ofTimeLimiterRegistry(
        TimeLimiterRegistry timeLimiterRegistry); @Override List<MetricFamilySamples> collect(); }
TimeLimiterMetricsCollector extends AbstractTimeLimiterMetrics { public static TimeLimiterMetricsCollector ofTimeLimiterRegistry(MetricNames names, TimeLimiterRegistry timeLimiterRegistry) { return new TimeLimiterMetricsCollector(names, timeLimiterRegistry); } private  TimeLimiterMetricsCollector(MetricNames names,
        TimeLimiterRegistry timeLimiterRegistry); static TimeLimiterMetricsCollector ofTimeLimiterRegistry(MetricNames names,
        TimeLimiterRegistry timeLimiterRegistry); static TimeLimiterMetricsCollector ofTimeLimiterRegistry(
        TimeLimiterRegistry timeLimiterRegistry); @Override List<MetricFamilySamples> collect();  }