Interface Timer.Builder

All Superinterfaces:
Meter.Builder<Timer.Builder,Timer>, Wrapper
Enclosing interface:
Timer

public static interface Timer.Builder extends Meter.Builder<Timer.Builder,Timer>
Builder for a new Timer.
See Also:
  • Method Details

    • baseUnit

      Timer.Builder baseUnit(String baseUnit)
      Units for the timer; developers are encouraged to use baseUnit(java.util.concurrent.TimeUnit) instead.

      By convention and specification, Prometheus output always uses SECONDS. Helidon's JSON output honors the baseUnit setting if configuration so indicates, and Helidon requires the value to be one of the TimeUnit enum values. (See the Helidon SE metrics documentation about understanding the JSON metrics data format.)

      Specified by:
      baseUnit in interface Meter.Builder<Timer.Builder,Timer>
      Parameters:
      baseUnit - timer unit
      Returns:
      updated builder
    • baseUnit

      default Timer.Builder baseUnit(TimeUnit baseUnit)
      Units for the timer.

      By convention and specification, Prometheus output always uses SECONDS. Helidon's JSON output honors the baseUnit setting if configuration so indicates. (See the Helidon SE metrics documentation about understanding the JSON metrics data format.)

      Parameters:
      baseUnit - timer unit
      Returns:
      updated builder
    • percentiles

      Timer.Builder percentiles(double... percentiles)
      Sets the percentiles to compute and publish (expressing, for example, the 95th percentile as 0.95).
      Parameters:
      percentiles - percentiles to compute and publish
      Returns:
      updated builder
    • buckets

      Timer.Builder buckets(Duration... buckets)
      Sets the boundary boundaries.
      Parameters:
      buckets - boundary boundaries
      Returns:
      updated builder
    • minimumExpectedValue

      Timer.Builder minimumExpectedValue(Duration min)
      Sets the minimum expected value the timer is expected to record.
      Parameters:
      min - minimum expected value
      Returns:
      updated builder
    • maximumExpectedValue

      Timer.Builder maximumExpectedValue(Duration max)
      Sets the maximum expected value the timer is expected to record.
      Parameters:
      max - maximum expected value
      Returns:
      updated builder
    • publishPercentileHistogram

      Timer.Builder publishPercentileHistogram(boolean value)
      Prepares the timer to publish a percentile histogram.
      Parameters:
      value - whether to publish a percentile histogram
      Returns:
      updated builder
    • percentiles

      Iterable<Double> percentiles()
      Returns the percentiles set in the builder, if any.
      Returns:
      percentiles
    • buckets

      Iterable<Duration> buckets()
      Returns the bucket boundary values set in the builder, if any.
      Returns:
      bucket boundary values
    • minimumExpectedValue

      Optional<Duration> minimumExpectedValue()
      Returns the minimum expected value set in the builder, if any.
      Returns:
      minimum expected value if set; empty otherwise
    • maximumExpectedValue

      Optional<Duration> maximumExpectedValue()
      Returns the maximum expected value set in the builder, if any.
      Returns:
      maximum expected value if set; empty otherwise
    • publishPercentileHistogram

      Optional<Boolean> publishPercentileHistogram()
      Returns the setting for publishing percentile histogram.
      Returns:
      whether to publish percentile histogram