Class TimeGauge.Builder<T>

java.lang.Object
io.micrometer.core.instrument.TimeGauge.Builder<T>
Enclosing interface:
TimeGauge

public static class TimeGauge.Builder<T>
extends java.lang.Object
Fluent builder for time gauges.
  • Method Summary

    Modifier and Type Method Description
    TimeGauge.Builder<T> description​(java.lang.String description)  
    TimeGauge register​(MeterRegistry registry)
    Add the time gauge to a single registry, or return an existing time gauge in that registry.
    TimeGauge.Builder<T> tag​(java.lang.String key, java.lang.String value)  
    TimeGauge.Builder<T> tags​(java.lang.Iterable<Tag> tags)  
    TimeGauge.Builder<T> tags​(java.lang.String... tags)  

    Methods inherited from class java.lang.Object

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

    • tags

      public TimeGauge.Builder<T> tags​(java.lang.String... tags)
      Parameters:
      tags - Must be an even number of arguments representing key/value pairs of tags.
      Returns:
      This time gauge builder.
    • tags

      public TimeGauge.Builder<T> tags​(java.lang.Iterable<Tag> tags)
      Parameters:
      tags - Tags to add to the eventual time gauge.
      Returns:
      The time gauge builder with added tags.
    • tag

      public TimeGauge.Builder<T> tag​(java.lang.String key, java.lang.String value)
      Parameters:
      key - The tag key.
      value - The tag value.
      Returns:
      The time gauge builder with a single added tag.
    • description

      public TimeGauge.Builder<T> description​(@Nullable java.lang.String description)
      Parameters:
      description - Description text of the eventual time gauge.
      Returns:
      The time gauge builder with added description.
    • register

      public TimeGauge register​(MeterRegistry registry)
      Add the time gauge to a single registry, or return an existing time gauge in that registry. The returned time gauge will be unique for each registry, but each registry is guaranteed to only create one time gauge for the same combination of name and tags.
      Parameters:
      registry - A registry to add the time gauge to, if it doesn't already exist.
      Returns:
      A new or existing time gauge.