Class FunctionCounter.TimeBasedBuilder<T>

java.lang.Object
io.micrometer.core.instrument.FunctionCounter.TimeBasedBuilder<T>
Type Parameters:
T - The type of the state object from which the counter value is extracted.
Enclosing interface:
FunctionCounter

public static final class FunctionCounter.TimeBasedBuilder<T> extends Object
Fluent builder for function counters that count monotonically increasing time.
Since:
1.18.0
  • Method Details

    • tags

      public FunctionCounter.TimeBasedBuilder<T> tags(String... tags)
      Parameters:
      tags - Must be an even number of arguments representing key/value pairs of tags.
      Returns:
      The function counter builder with added tags.
    • tags

      Parameters:
      tags - Tags to add to the eventual function counter.
      Returns:
      The function counter builder with added tags.
    • tag

      public FunctionCounter.TimeBasedBuilder<T> tag(String key, String value)
      Parameters:
      key - The tag key.
      value - The tag value.
      Returns:
      The function counter builder with a single added tag.
    • description

      public FunctionCounter.TimeBasedBuilder<T> description(@Nullable String description)
      Parameters:
      description - Description text of the eventual function counter.
      Returns:
      The function counter builder with added description.
    • register

      public FunctionCounter register(MeterRegistry registry)
      Register the function counter with the registry. If a meter with the same name and tags is already registered, the existing function counter is returned and this registration call has no effect.
      Parameters:
      registry - Registry to register the function counter with.
      Returns:
      The registered function counter.