类 WindowWrap<T>

java.lang.Object
com.alibaba.csp.sentinel.slots.statistic.base.WindowWrap<T>
类型参数:
T - data type

public class WindowWrap<T> extends Object
Wrapper entity class for a period of time window.
作者:
jialiang.linjl, Eric Zhao
  • 构造器详细资料

    • WindowWrap

      public WindowWrap(long windowLengthInMs, long windowStart, T value)
      参数:
      windowLengthInMs - a single window bucket's time length in milliseconds.
      windowStart - the start timestamp of the window
      value - statistic data
  • 方法详细资料

    • windowLength

      public long windowLength()
    • windowStart

      public long windowStart()
    • value

      public T value()
    • setValue

      public void setValue(T value)
    • resetTo

      public WindowWrap<T> resetTo(long startTime)
      Reset start timestamp of current bucket to provided time.
      参数:
      startTime - valid start timestamp
      返回:
      bucket after reset
    • isTimeInWindow

      public boolean isTimeInWindow(long timeMillis)
      Check whether given timestamp is in current bucket.
      参数:
      timeMillis - valid timestamp in ms
      返回:
      true if the given time is in current bucket, otherwise false
      从以下版本开始:
      1.5.0
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object