public final class ConnPoolMetersAsync extends Object implements io.micrometer.core.instrument.binder.MeterBinder
HttpAsyncClientBuilder.
Exposes:
<prefix>.pool.leased – number of leased connections<prefix>.pool.available – number of available (idle) connections<prefix>.pool.pending – number of pending connection requestsprefix and any common tags come from MetricConfig.
Usage
MeterRegistry meters = new PrometheusMeterRegistry(PrometheusConfig.DEFAULT);
MetricConfig mc = MetricConfig.builder().prefix("http_client").build();
HttpAsyncClientBuilder b = HttpAsyncClients.custom()
.setConnectionManager(PoolingAsyncClientConnectionManagerBuilder.create().build());
// After the async connection manager is attached to the builder:
ConnPoolMetersAsync.bindTo(b, meters, mc);
Note: This binder reads the async connection manager from
the HttpAsyncClientBuilder. If the builder has no manager attached or
it does not implement ConnPoolControl, this method is a no-op.
| Modifier and Type | Method and Description |
|---|---|
static void |
bindTo(HttpAsyncClientBuilder builder,
io.micrometer.core.instrument.MeterRegistry registry)
Binds pool gauges using
MetricConfig.DEFAULT. |
static void |
bindTo(HttpAsyncClientBuilder builder,
io.micrometer.core.instrument.MeterRegistry registry,
MetricConfig mc)
Binds pool gauges for the async connection manager currently attached to the builder.
|
void |
bindTo(io.micrometer.core.instrument.MeterRegistry registry) |
public void bindTo(io.micrometer.core.instrument.MeterRegistry registry)
bindTo in interface io.micrometer.core.instrument.binder.MeterBinderpublic static void bindTo(HttpAsyncClientBuilder builder, io.micrometer.core.instrument.MeterRegistry registry, MetricConfig mc)
ConnPoolControl,
this method is a no-op.builder - async client builderregistry - meter registrymc - metric configuration (prefix, common tags)public static void bindTo(HttpAsyncClientBuilder builder, io.micrometer.core.instrument.MeterRegistry registry)
MetricConfig.DEFAULT.builder - async client builderregistry - meter registryCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.