Skip to content

Commit

Permalink
remove some unused code (#3363)
Browse files Browse the repository at this point in the history
Signed-off-by: rleungx <rleungx@gmail.com>
  • Loading branch information
rleungx authored Jan 18, 2021
1 parent 5f447ae commit 02c5f77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions pkg/movingaverage/time_median.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import "time"
// Delay is aotSize * mfSize * reportInterval/4
// and the min filled period is aotSize * reportInterval, which is not related with mfSize
type TimeMedian struct {
aotInterval time.Duration
aot *AvgOverTime
mf *MedianFilter
aotSize int
Expand All @@ -31,11 +30,10 @@ type TimeMedian struct {
// NewTimeMedian returns a TimeMedian with given size.
func NewTimeMedian(aotSize, mfSize int, reportInterval time.Duration) *TimeMedian {
return &TimeMedian{
aotInterval: reportInterval,
aot: NewAvgOverTime(time.Duration(aotSize) * reportInterval),
mf: NewMedianFilter(mfSize),
aotSize: aotSize,
mfSize: mfSize,
aot: NewAvgOverTime(time.Duration(aotSize) * reportInterval),
mf: NewMedianFilter(mfSize),
aotSize: aotSize,
mfSize: mfSize,
}
}

Expand Down
2 changes: 1 addition & 1 deletion server/statistics/hot_peer_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ func (f *hotPeerCache) getDefaultTimeMedian() *movingaverage.TimeMedian {
}

func (f *hotPeerCache) updateHotPeerStat(newItem, oldItem *HotPeerStat, bytes, keys float64, interval time.Duration) *HotPeerStat {
if newItem == nil || newItem.needDelete {
if newItem.needDelete {
return newItem
}

Expand Down

0 comments on commit 02c5f77

Please sign in to comment.