类 TpsRecorder


  • public class TpsRecorder
    extends java.lang.Object
    tps record.
    版本:
    $Id: TpsRecorder.java, v 0.1 2021年01月09日 12:38 PM liuzunfei Exp $
    作者:
    liuzunfei
    • 字段详细资料

      • startTime

        private long startTime
      • period

        java.util.concurrent.TimeUnit period
      • slotSize

        private int slotSize
      • maxCount

        private long maxCount
      • model

        private java.lang.String model
      • monitorType

        private java.lang.String monitorType
        monitor/intercept.
    • 构造器详细资料

      • TpsRecorder

        public TpsRecorder​(long startTime,
                           java.util.concurrent.TimeUnit period,
                           java.lang.String model,
                           int recordSize)
    • 方法详细资料

      • isProtoModel

        public boolean isProtoModel()
      • getModel

        public java.lang.String getModel()
      • setModel

        public void setModel​(java.lang.String model)
      • createSlotIfAbsent

        public TpsRecorder.TpsSlot createSlotIfAbsent​(long timeStamp)
        get slot of the timestamp second,create if not exist.
        参数:
        timeStamp - the timestamp second.
        返回:
        tps slot.
      • getPoint

        public TpsRecorder.TpsSlot getPoint​(long timeStamp)
        get slot of the timestamp second,read only ,return nul if not exist.
        参数:
        timeStamp - the timestamp second.
        返回:
        tps slot.
      • getMaxCount

        public long getMaxCount()
      • setMaxCount

        public void setMaxCount​(long maxCount)
      • isInterceptMode

        public boolean isInterceptMode()
      • clearLimitRule

        public void clearLimitRule()
        clearLimitRule.
      • getMonitorType

        public java.lang.String getMonitorType()
      • setMonitorType

        public void setMonitorType​(java.lang.String monitorType)