Search in sources :

Example 1 with SUCCESSFUL_CALLS_WITH_RETRY

use of io.github.resilience4j.retry.utils.MetricNames.SUCCESSFUL_CALLS_WITH_RETRY in project resilience4j by resilience4j.

the class RetryMetrics method bindTo.

@Override
public void bindTo(MeterRegistry registry) {
    for (Retry retry : retries) {
        final String name = retry.getName();
        Gauge.builder(getName(prefix, name, SUCCESSFUL_CALLS_WITHOUT_RETRY), retry, (cb) -> cb.getMetrics().getNumberOfSuccessfulCallsWithoutRetryAttempt()).register(registry);
        Gauge.builder(getName(prefix, name, SUCCESSFUL_CALLS_WITH_RETRY), retry, (cb) -> cb.getMetrics().getNumberOfSuccessfulCallsWithRetryAttempt()).register(registry);
        Gauge.builder(getName(prefix, name, FAILED_CALLS_WITHOUT_RETRY), retry, (cb) -> cb.getMetrics().getNumberOfFailedCallsWithoutRetryAttempt()).register(registry);
        Gauge.builder(getName(prefix, name, FAILED_CALLS_WITH_RETRY), retry, (cb) -> cb.getMetrics().getNumberOfFailedCallsWithRetryAttempt()).register(registry);
    }
}
Also used : DEFAULT_PREFIX(io.github.resilience4j.retry.utils.MetricNames.DEFAULT_PREFIX) SUCCESSFUL_CALLS_WITH_RETRY(io.github.resilience4j.retry.utils.MetricNames.SUCCESSFUL_CALLS_WITH_RETRY) Retry(io.github.resilience4j.retry.Retry) Gauge(io.micrometer.core.instrument.Gauge) MetricUtils.getName(io.github.resilience4j.micrometer.MetricUtils.getName) SUCCESSFUL_CALLS_WITHOUT_RETRY(io.github.resilience4j.retry.utils.MetricNames.SUCCESSFUL_CALLS_WITHOUT_RETRY) MeterBinder(io.micrometer.core.instrument.binder.MeterBinder) FAILED_CALLS_WITHOUT_RETRY(io.github.resilience4j.retry.utils.MetricNames.FAILED_CALLS_WITHOUT_RETRY) FAILED_CALLS_WITH_RETRY(io.github.resilience4j.retry.utils.MetricNames.FAILED_CALLS_WITH_RETRY) MeterRegistry(io.micrometer.core.instrument.MeterRegistry) Objects.requireNonNull(java.util.Objects.requireNonNull) RetryRegistry(io.github.resilience4j.retry.RetryRegistry) RateLimiterRegistry(io.github.resilience4j.ratelimiter.RateLimiterRegistry) Retry(io.github.resilience4j.retry.Retry)

Aggregations

MetricUtils.getName (io.github.resilience4j.micrometer.MetricUtils.getName)1 RateLimiterRegistry (io.github.resilience4j.ratelimiter.RateLimiterRegistry)1 Retry (io.github.resilience4j.retry.Retry)1 RetryRegistry (io.github.resilience4j.retry.RetryRegistry)1 DEFAULT_PREFIX (io.github.resilience4j.retry.utils.MetricNames.DEFAULT_PREFIX)1 FAILED_CALLS_WITHOUT_RETRY (io.github.resilience4j.retry.utils.MetricNames.FAILED_CALLS_WITHOUT_RETRY)1 FAILED_CALLS_WITH_RETRY (io.github.resilience4j.retry.utils.MetricNames.FAILED_CALLS_WITH_RETRY)1 SUCCESSFUL_CALLS_WITHOUT_RETRY (io.github.resilience4j.retry.utils.MetricNames.SUCCESSFUL_CALLS_WITHOUT_RETRY)1 SUCCESSFUL_CALLS_WITH_RETRY (io.github.resilience4j.retry.utils.MetricNames.SUCCESSFUL_CALLS_WITH_RETRY)1 Gauge (io.micrometer.core.instrument.Gauge)1 MeterRegistry (io.micrometer.core.instrument.MeterRegistry)1 MeterBinder (io.micrometer.core.instrument.binder.MeterBinder)1 Objects.requireNonNull (java.util.Objects.requireNonNull)1