Interface MeterRegistry


public interface MeterRegistry
A meter registry akin to micrometer.
Author:
Holger Eichelberger, SSE
  • Method Details

    • config

      Returns the registry configuration.
      Returns:
      A configuration object used to change the behavior of this registry.
    • remove

      Meter remove(Meter meter)
      Remove a Meter from this registry. This is expected to be a Meter with the same Meter.Id returned when registering a meter - which will have MeterFilters applied to it.
      Parameters:
      meter - The meter to remove
      Returns:
      The removed meter (may not be the same instance as registered before), or null if the provided meter is not currently registered.
    • remove

      Meter remove(String name)
      Remove a Meter from this registry. This is expected to be a Meter with the same Meter.Id returned when registering a meter - which will have MeterFilters applied to it. May affect multiple meters as tags not specified here.
      Parameters:
      name - the name of the meter to remove
      Returns:
      The removed meter (may not be the same instance as registered before), or null if the provided meter is not currently registered.
    • remove

      Meter remove(Meter.Id id)
      Remove a Meter from this registry based the given Meter.Id as-is. The registry's MeterFilters will not be applied to it. You can use the Meter.Id of the Meter returned when registering a meter, since that will have MeterFilters already applied to it.
      Parameters:
      id - The id of the meter to remove
      Returns:
      The removed meter, or null if no meter matched the provided id
    • getMeter

      Meter getMeter(String name)
      Returns the meter of the specified name.
      Parameters:
      name - the name
      Returns:
      the meter, may not be the same instance as returned before, may be null for none
    • getMeter

      Meter getMeter(String name, Iterable<Tag> tags)
      Returns the meter of the specified name matching the given tags.
      Parameters:
      name - the name
      Returns:
      the meter, may not be the same instance as returned before, may be null for none
    • getGauge

      Gauge getGauge(String name)
      Returns the gauge of the specified name.
      Parameters:
      name - the name
      Returns:
      the gauge, may be null for none
    • getCounter

      Counter getCounter(String name)
      Returns the counter of the specified name.
      Parameters:
      name - the name
      Returns:
      the counter, may be null for none
    • getTimer

      Timer getTimer(String name)
      Returns the timer of the specified name.
      Parameters:
      name - the name
      Returns:
      the timer, may be null for none
    • gauge

      <T extends Number> T gauge(String name, T number)
      Register a gauge that reports the value of the Number.
      Type Parameters:
      T - The type of the state object from which the gauge value is extracted.
      Parameters:
      name - Name of the gauge being registered.
      number - Thread-safe implementation of Number used to access the value.
      Returns:
      The number that was passed in so the registration can be done as part of an assignment statement.
    • counter

      Counter counter(String name, String... tags)
      Tracks a monotonically increasing value.
      Parameters:
      name - The base metric name
      tags - MUST be an even number of arguments representing key/value pairs of tags.
      Returns:
      A new or existing counter.
    • timer

      Timer timer(String name, String... tags)
      Measures the time taken for short tasks and the count of these tasks.
      Parameters:
      name - The base metric name
      tags - MUST be an even number of arguments representing key/value pairs of tags.
      Returns:
      A new or existing timer.
    • getMeters

      List<Meter> getMeters()
      Returns the registered meters.
      Returns:
      the registered meters.