Class FunctionTimer.Builder<T>

  • Type Parameters:
    T - The type of the state object from which the timer values are extracted.
    Enclosing interface:
    FunctionTimer

    public static class FunctionTimer.Builder<T>
    extends java.lang.Object
    Fluent builder for function timer.
    • Method Detail

      • tags

        public FunctionTimer.Builder<T> tags​(java.lang.String... tags)
        Parameters:
        tags - Must be an even number of arguments representing key/value pairs of tags.
        Returns:
        The function timer builder with added tags.
      • tags

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

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

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

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