Class SampledStatisticAdapter<T extends java.io.Serializable>

    • Field Detail

      • timeSource

        private final java.util.function.LongSupplier timeSource
      • statistic

        private final ValueStatistic<T extends java.io.Serializable> statistic
    • Constructor Detail

      • SampledStatisticAdapter

        private SampledStatisticAdapter​(ValueStatistic<T> statistic,
                                        java.util.function.LongSupplier timeSource)
    • Method Detail

      • value

        public T value()
        Specified by:
        value in interface ValueStatistic<T extends java.io.Serializable>
        Returns:
        The current statistic value
      • history

        public java.util.List<Sample<T>> history​(long since)
        Description copied from interface: SampledStatistic
        The history of values, since a given time in ms
        Specified by:
        history in interface SampledStatistic<T extends java.io.Serializable>
        Parameters:
        since - starting point of history in ms
        Returns:
        the list
      • sample

        public static <T extends java.io.Serializable> SampledStatistic<T> sample​(ValueStatistic<T> accessor,
                                                                                  java.util.function.LongSupplier timeSource)