Interface Meter.MeterProvider<T extends Meter>

Type Parameters:
T - Meter type
Enclosing interface:
Meter

public static interface Meter.MeterProvider<T extends Meter>
Convenience interface to create new meters from tags based on a common "template"/builder. See usage in Meter implementations, e.g.: Timer, Counter
Since:
1.12.0
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    withTag(String key, String value)
    Registers (creates a new or gets an existing one if already exists) Meters using the provided tags.
    withTags(Iterable<? extends Tag> tags)
    Registers (creates a new or gets an existing one if already exists) Meters using the provided tags.
    default T
    withTags(String... tags)
    Registers (creates a new or gets an existing one if already exists) Meters using the provided tags.
  • Method Details

    • withTags

      T withTags(Iterable<? extends Tag> tags)
      Registers (creates a new or gets an existing one if already exists) Meters using the provided tags.
      Parameters:
      tags - Tags to attach to the Meter about to be registered
      Returns:
      A new or existing Meter
    • withTags

      default T withTags(String... tags)
      Registers (creates a new or gets an existing one if already exists) Meters using the provided tags.
      Parameters:
      tags - Tags to attach to the Meter about to be registered
      Returns:
      A new or existing Meter
    • withTag

      default T withTag(String key, String value)
      Registers (creates a new or gets an existing one if already exists) Meters using the provided tags.
      Parameters:
      key - the tag key to add
      value - the tag value to add
      Returns:
      A new or existing Meter