Interface CallMeter

All Superinterfaces:
CallMeterBase

public interface CallMeter
extends CallMeterBase
  • Method Details

    • of

      static CallMeter of​(java.lang.String name, java.lang.String help)
      Creates call meter with the given name and help message
      Parameters:
      name - - metric name
      help - - metric help
      Returns:
      the call meter
    • ofCollectorRegistry

      static CallMeter ofCollectorRegistry​(java.lang.String name, java.lang.String help, io.prometheus.client.CollectorRegistry registry)
      Creates call meter with the given name and registers it in the specified collector registry
      Parameters:
      name - - metric name
      help - - metric help
      registry - - collector registry
      Returns:
      the call meter
    • builder

      static CallMeter.Builder builder()
      Creates a new call meter CallMeter.Builder
      Returns:
      the new CallMeter.Builder
    • decorateCheckedSupplier

      static <T> io.vavr.CheckedFunction0<T> decorateCheckedSupplier​(CallMeterBase meter, io.vavr.CheckedFunction0<T> supplier)
      Creates a timed checked supplier.
      Parameters:
      meter - the call meter to use
      supplier - the original supplier
      Returns:
      a timed supplier
    • decorateCheckedRunnable

      static io.vavr.CheckedRunnable decorateCheckedRunnable​(CallMeterBase meter, io.vavr.CheckedRunnable runnable)
      Creates a timed runnable.
      Parameters:
      meter - the call meter to use
      runnable - the original runnable
      Returns:
      a timed runnable
    • decorateSupplier

      static <T> java.util.function.Supplier<T> decorateSupplier​(CallMeterBase meter, java.util.function.Supplier<T> supplier)
      Creates a timed checked supplier.
      Parameters:
      meter - the call meter to use
      supplier - the original supplier
      Returns:
      a timed supplier
    • decorateCallable

      static <T> java.util.concurrent.Callable<T> decorateCallable​(CallMeterBase meter, java.util.concurrent.Callable<T> callable)
      Creates a timed Callable.
      Parameters:
      meter - the call meter to use
      callable - the original Callable
      Returns:
      a timed Callable
    • decorateRunnable

      static java.lang.Runnable decorateRunnable​(CallMeterBase meter, java.lang.Runnable runnable)
      Creates a timed runnable.
      Parameters:
      meter - the call meter to use
      runnable - the original runnable
      Returns:
      a timed runnable
    • decorateFunction

      static <T,​ R> java.util.function.Function<T,​R> decorateFunction​(CallMeterBase meter, java.util.function.Function<T,​R> function)
      Creates a timed function.
      Parameters:
      meter - the call meter to use
      function - the original function
      Returns:
      a timed function
    • decorateCheckedFunction

      static <T,​ R> io.vavr.CheckedFunction1<T,​R> decorateCheckedFunction​(CallMeterBase meter, io.vavr.CheckedFunction1<T,​R> function)
      Creates a timed function.
      Parameters:
      meter - the call meter to use
      function - the original function
      Returns:
      a timed function
    • decorateCompletionStageSupplier

      static <T> java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> decorateCompletionStageSupplier​(CallMeterBase meter, java.util.function.Supplier<java.util.concurrent.CompletionStage<T>> stageSupplier)
      Decorates completion stage supplier with call meter
      Parameters:
      meter - the call meter to use
      stageSupplier - the CompletionStage Supplier
      Returns:
      a decorated completion stage
    • labels

      CallMeter.Child labels​(java.lang.String... labels)
      Creates a child call meter with the given labels
      Parameters:
      labels -
      Returns:
      child collector
    • register

      default CallMeter register()
      Register this call meter with the default registry.
    • register

      CallMeter register​(io.prometheus.client.CollectorRegistry registry)
      Registers this call meter with the given registry.