Class Pane<T>

java.lang.Object
org.apache.dubbo.metrics.aggregate.Pane<T>
Type Parameters:
T - The type of value the pane statistics.

public class Pane<T> extends Object
The pane represents a window over a period of time.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Pane(long intervalInMs, long startInMs, T value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Get end timestamp of the pane in milliseconds.
    long
    Get the interval of the pane in milliseconds.
    long
    Get start timestamp of the pane in milliseconds.
    Get the pane statistics value.
    boolean
    isTimeInWindow(long timeMillis)
    Check whether given timestamp is in current pane.
    void
    setStartInMs(long newStartInMs)
    Set the new start timestamp to the pane, for reset the instance.
    void
    setValue(T newData)
    Set new value to the pane, for reset the instance.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Pane

      public Pane(long intervalInMs, long startInMs, T value)
      Parameters:
      intervalInMs - interval of the pane in milliseconds.
      startInMs - start timestamp of the pane in milliseconds.
      value - the pane value.
  • Method Details

    • getIntervalInMs

      public long getIntervalInMs()
      Get the interval of the pane in milliseconds.
      Returns:
      the interval of the pane in milliseconds.
    • getStartInMs

      public long getStartInMs()
      Get start timestamp of the pane in milliseconds.
      Returns:
      the start timestamp of the pane in milliseconds.
    • getEndInMs

      public long getEndInMs()
      Get end timestamp of the pane in milliseconds.
      Returns:
      the end timestamp of the pane in milliseconds.
    • getValue

      public T getValue()
      Get the pane statistics value.
      Returns:
      the pane statistics value.
    • setStartInMs

      public void setStartInMs(long newStartInMs)
      Set the new start timestamp to the pane, for reset the instance.
      Parameters:
      newStartInMs - the new start timestamp.
    • setValue

      public void setValue(T newData)
      Set new value to the pane, for reset the instance.
      Parameters:
      newData - the new value.
    • isTimeInWindow

      public boolean isTimeInWindow(long timeMillis)
      Check whether given timestamp is in current pane.
      Parameters:
      timeMillis - timestamp in milliseconds.
      Returns:
      true if the given time is in current pane, otherwise false