use of io.micrometer.core.instrument.MeterRegistry in project resilience4j by resilience4j.
the class RateLimiterMetrics method bindTo.
@Override
public void bindTo(MeterRegistry registry) {
for (RateLimiter rateLimiter : rateLimiters) {
final String name = rateLimiter.getName();
Gauge.builder(getName(prefix, name, AVAILABLE_PERMISSIONS), rateLimiter, (cb) -> cb.getMetrics().getAvailablePermissions()).register(registry);
Gauge.builder(getName(prefix, name, WAITING_THREADS), rateLimiter, (cb) -> cb.getMetrics().getNumberOfWaitingThreads()).register(registry);
}
}
use of io.micrometer.core.instrument.MeterRegistry 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);
}
}
Aggregations