public final class MetricCollectingClient extends SimpleDecoratingClient<I,O> implements HttpClient
HttpClient to collect metrics into MeterRegistry.
Example:
WebClient client = WebClient
.builder(uri)
.decorator(MetricCollectingClient.newDecorator(MeterIdPrefixFunction.ofDefault("myClient")))
.build();
It is generally recommended not to use a class or package name as a metric name, because otherwise seemingly harmless refactoring such as rename may break metric collection.
| Modifier and Type | Method and Description |
|---|---|
O |
execute(ClientRequestContext ctx,
I req)
|
static Function<? super HttpClient,MetricCollectingClient> |
newDecorator(MeterIdPrefixFunction meterIdPrefixFunction)
Returns an
HttpClient decorator that tracks request stats using MeterRegistry. |
as, delegate, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitexecutepublic static Function<? super HttpClient,MetricCollectingClient> newDecorator(MeterIdPrefixFunction meterIdPrefixFunction)
HttpClient decorator that tracks request stats using MeterRegistry.Copyright © 2020 LeanCloud. All rights reserved.