Class AbstractMetricCollectingBuilder
java.lang.Object
com.linecorp.armeria.common.metric.AbstractMetricCollectingBuilder
- Direct Known Subclasses:
MetricCollectingClientBuilder
,MetricCollectingRpcClientBuilder
,MetricCollectingServiceBuilder
Builds an implementing class of
AbstractMetricCollectingBuilder
instance.-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractMetricCollectingBuilder
(MeterIdPrefixFunction meterIdPrefixFunction) Creates a new instance with the specifiedMeterIdPrefixFunction
. -
Method Summary
Modifier and TypeMethodDescriptionprotected final DistributionStatisticConfig
Returns thedistributionStatisticConfig
.distributionStatisticConfig
(DistributionStatisticConfig distributionStatisticConfig) Defines a customDistributionStatisticConfig
to use for the distribution config.protected MeterIdPrefixFunction
Returns theMeterIdPrefixFunction
.protected final @Nullable BiPredicate
<? super RequestContext, ? super RequestLog> Returns thesuccessFunction
.successFunction
(BiPredicate<? super RequestContext, ? super RequestLog> successFunction) Deprecated.
-
Constructor Details
-
AbstractMetricCollectingBuilder
Creates a new instance with the specifiedMeterIdPrefixFunction
.
-
-
Method Details
-
meterIdPrefixFunction
Returns theMeterIdPrefixFunction
. -
successFunction
@Nullable protected final @Nullable BiPredicate<? super RequestContext,? super RequestLog> successFunction()Returns thesuccessFunction
. -
successFunction
@Deprecated public AbstractMetricCollectingBuilder successFunction(BiPredicate<? super RequestContext, ? super RequestLog> successFunction) Deprecated.Defines a customBiPredicate
to allow custom definition of successful responses. In other words, specify which responses should incrementmetrics.success()
and which -metrics.failure()
.Example:
MetricCollectingService .builder(MeterIdPrefixFunction.ofDefault("hello")) .successFunction((context, log) -> { final int statusCode = log.responseHeaders().status().code(); return (statusCode >= 200 && statusCode < 400) || statusCode == 404; }) .newDecorator();
-
distributionStatisticConfig
Returns thedistributionStatisticConfig
. -
distributionStatisticConfig
public AbstractMetricCollectingBuilder distributionStatisticConfig(DistributionStatisticConfig distributionStatisticConfig) Defines a customDistributionStatisticConfig
to use for the distribution config.
-
ClientBuilder.successFunction(SuccessFunction)
orServerBuilder.successFunction(SuccessFunction)
.