All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.dropwizard.metrics5.httpclient5.HttpClientMetricNameStrategy Maven / Gradle / Ivy

Go to download

An Apache HttpClient 5.x wrapper providing Metrics instrumentation of connection pools, request durations and rates, and other useful information.

There is a newer version: 5.0.0-rc24
Show newest version
package io.dropwizard.metrics5.httpclient5;

import io.dropwizard.metrics5.MetricName;
import io.dropwizard.metrics5.MetricRegistry;
import org.apache.hc.client5.http.classic.HttpClient;
import org.apache.hc.core5.http.HttpRequest;

@FunctionalInterface
public interface HttpClientMetricNameStrategy {

    MetricName getNameFor(String name, HttpRequest request);

    default MetricName getNameFor(String name, Exception exception) {
        return MetricRegistry.name(HttpClient.class,
                name,
                exception.getClass().getSimpleName());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy