Class AbstractMetricCollectingInterceptor.MetricSet

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

protected static class AbstractMetricCollectingInterceptor.MetricSet extends Object
Container for all metrics of a certain call. Used instead of 3 maps to improve performance.
  • 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

      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 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.