AppendNewReqTime append new request time
()
| 98 | |
| 99 | //AppendNewReqTime append new request time |
| 100 | func (this *NodeWeight) AppendNewReqtime() { |
| 101 | copy(this.reqTime[0:SYNC_NODE_RECORD_TIME_CNT-1], this.reqTime[1:]) |
| 102 | this.reqTime[SYNC_NODE_RECORD_TIME_CNT-1] = time.Now().UnixNano() / int64(time.Millisecond) |
| 103 | } |
| 104 | |
| 105 | //addNewSpeed apend the new speed to tail, remove the oldest one |
| 106 | func (this *NodeWeight) AppendNewSpeed(s float32) { |