Interface FunctionTimer

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  FunctionTimer.Builder<T>
      Fluent builder for function timer.
    • Method Detail

      • builder

        static <T> FunctionTimer.Builder<T> builder​(java.lang.String name,
                                                    T obj,
                                                    java.util.function.ToLongFunction<T> countFunction,
                                                    java.util.function.ToDoubleFunction<T> totalTimeFunction,
                                                    java.util.concurrent.TimeUnit totalTimeFunctionUnit)
      • count

        double count()
        Returns:
        The total number of occurrences of the timed event.
      • totalTime

        double totalTime​(java.util.concurrent.TimeUnit unit)
        The total time of all occurrences of the timed event.
        Parameters:
        unit - The base unit of time to scale the total to.
        Returns:
        The total time of all occurrences of the timed event.
      • mean

        default double mean​(java.util.concurrent.TimeUnit unit)
        Parameters:
        unit - The base unit of time to scale the mean to.
        Returns:
        The distribution average for all recorded events.
      • baseTimeUnit

        java.util.concurrent.TimeUnit baseTimeUnit()
        Returns:
        The base time unit of the timer to which all published metrics will be scaled
      • measure

        default java.lang.Iterable<Measurement> measure()
        Description copied from interface: Meter
        Get a set of measurements. Should always return the same number of measurements and in the same order, regardless of the level of activity or the lack thereof.
        Specified by:
        measure in interface Meter
        Returns:
        The set of measurements that represents the instantaneous value of this meter.