use of io.github.resilience4j.retry.RetryRegistry in project resilience4j by resilience4j.
the class RetryMetricsTest method shouldRegisterMetrics.
@Test
public void shouldRegisterMetrics() {
RetryRegistry retryRegistry = RetryRegistry.ofDefaults();
retryRegistry.retry("testName");
RetryMetrics retryMetrics = RetryMetrics.ofRetryRegistry(retryRegistry);
retryMetrics.bindTo(meterRegistry);
final List<String> metricNames = meterRegistry.getMeters().stream().map(Meter::getId).map(Meter.Id::getName).collect(Collectors.toList());
final List<String> expectedMetrics = newArrayList("resilience4j.retry.testName.successful_calls_with_retry", "resilience4j.retry.testName.failed_calls_with_retry", "resilience4j.retry.testName.successful_calls_without_retry", "resilience4j.retry.testName.failed_calls_without_retry");
assertThat(metricNames).hasSameElementsAs(expectedMetrics);
}
Aggregations