Class AbstractMetricCollectingInterceptor.MetricSet
java.lang.Object
io.micrometer.core.instrument.binder.grpc.AbstractMetricCollectingInterceptor.MetricSet
- Enclosing class:
AbstractMetricCollectingInterceptor
Container for all metrics of a certain call. Used instead of 3 maps to improve
performance.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets the Counter that counts the request messages.Gets the Counter that counts the response messages.Consumer<io.grpc.Status.Code>
newProcessingDurationTiming
(MeterRegistry registry) Uses the given registry to create aTimer.Sample
that will be reported if the returned consumer is invoked.
-
Constructor Details
-
MetricSet
public MetricSet(Counter requestCounter, Counter responseCounter, Function<io.grpc.Status.Code, Timer> timerFunction) Creates a new metric set with the given meter instances.- Parameters:
requestCounter
- The request counter to use.responseCounter
- The response counter to use.timerFunction
- The timer function to use.
-
-
Method Details
-
getRequestCounter
Gets the Counter that counts the request messages.- Returns:
- The Counter that counts the request messages.
-
getResponseCounter
Gets the Counter that counts the response messages.- Returns:
- The Counter that counts the response messages.
-
newProcessingDurationTiming
Uses the given registry to create aTimer.Sample
that will be reported if the returned consumer is invoked.- Parameters:
registry
- The registry used to create the sample.- Returns:
- The newly created consumer that will report the processing duration since calling this method and invoking the returned consumer along with the status code.
-