Interface MaxPeriodical<T extends Comparable<T>>

  • All Known Implementing Classes:
    StoredMaxPeriodical

    public interface MaxPeriodical<T extends Comparable<T>>
    Created by Andrey Titov on 1/30/17.
    • Method Detail

      • peek

        @NotNull
        List<MaxPeriodical.Data<T>> peek​(long since,
                                         long till)
        Parameters:
        since - start of the range
        till - end of the range
        Returns:
        A list of available maximums. Empty list if the range is not available.
      • peek

        @NotNull
        T peek()
        Returns:
        current maximum
      • peek

        @NotNull
        MaxPeriodical.Data<T> peek​(long timestamp)
        Returns:
        current maximum with range data (since last reset till passed timestamp)
      • getLastUpdateTime

        long getLastUpdateTime()
        Returns:
        timestamp of last update
      • getMinValue

        @NotNull
        T getMinValue()
        Returns:
        minimal value of this metric
      • reset

        MaxPeriodical.Data<T> reset​(long timestamp)
        Sets current maximum to minimal value (see getMinValue()) and start new period
        Parameters:
        timestamp -
        Returns:
      • update

        boolean update​(@NotNull
                       T currentValue,
                       long timestamp)
        Updates current maximum if provided value is greater than current peek() and if provided timestamp is not less than getLastUpdateTime()
        Parameters:
        currentValue - value to set
        timestamp - current timestamp
        Returns:
        true if current maximum was updated