public final class MetricCollectingRpcClient extends SimpleDecoratingClient<I,O> implements RpcClient
RpcClient to collect metrics into MeterRegistry.
Example:
MyService.Iface client =
Clients.builder(uri)
.decorator(MetricCollectingRpcClient.newDecorator(MeterIdPrefixFunction.ofDefault("myClient")))
.build(MyService.Iface.class);
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 RpcClient,MetricCollectingRpcClient> |
newDecorator(MeterIdPrefixFunction meterIdPrefixFunction)
Returns an
RpcClient decorator that tracks request stats using MeterRegistry. |
as, delegate, toStringpublic static Function<? super RpcClient,MetricCollectingRpcClient> newDecorator(MeterIdPrefixFunction meterIdPrefixFunction)
RpcClient decorator that tracks request stats using MeterRegistry.Copyright © 2020 LeanCloud. All rights reserved.