Class AbstractMetricCollectingInterceptor.MetricSet

java.lang.Object
io.micrometer.core.instrument.binder.grpc.AbstractMetricCollectingInterceptor.MetricSet
Enclosing class:
AbstractMetricCollectingInterceptor

protected static class AbstractMetricCollectingInterceptor.MetricSet
extends java.lang.Object
Container for all metrics of a certain call. Used instead of 3 maps to improve performance.
  • Constructor Summary

    Constructors
    Constructor Description
    MetricSet​(Counter requestCounter, Counter responseCounter, java.util.function.Function<io.grpc.Status.Code,​Timer> timerFunction)
    Creates a new metric set with the given meter instances.
  • Method Summary

    Modifier and Type Method Description
    Counter getRequestCounter()
    Gets the Counter that counts the request messages.
    Counter getResponseCounter()
    Gets the Counter that counts the response messages.
    java.util.function.Consumer<io.grpc.Status.Code> newProcessingDurationTiming​(MeterRegistry registry)
    Uses the given registry to create a Timer.Sample that will be reported if the returned consumer is invoked.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MetricSet

      public MetricSet​(Counter requestCounter, Counter responseCounter, java.util.function.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

      public Counter getRequestCounter()
      Gets the Counter that counts the request messages.
      Returns:
      The Counter that counts the request messages.
    • getResponseCounter

      public Counter getResponseCounter()
      Gets the Counter that counts the response messages.
      Returns:
      The Counter that counts the response messages.
    • newProcessingDurationTiming

      public java.util.function.Consumer<io.grpc.Status.Code> newProcessingDurationTiming​(MeterRegistry registry)
      Uses the given registry to create a Timer.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.