Skip to content

Commit

Permalink
Merge branch 'master' into balance-witness
Browse files Browse the repository at this point in the history
  • Loading branch information
ethercflow committed Dec 7, 2022
2 parents 9a76947 + b072008 commit 4c5eb07
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/statistics/hot_peer_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ func NewHotPeerCache(kind RWType) *hotPeerCache {
// RegionStats returns hot items
func (f *hotPeerCache) RegionStats(minHotDegree int) map[uint64][]*HotPeerStat {
res := make(map[uint64][]*HotPeerStat)
defaultAntiCount := f.kind.DefaultAntiCount()
for storeID, peers := range f.peersOfStore {
values := peers.GetAll()
stat := make([]*HotPeerStat, 0, len(values))
for _, v := range values {
if peer := v.(*HotPeerStat); peer.HotDegree >= minHotDegree && !peer.inCold && peer.AntiCount == f.kind.DefaultAntiCount() {
if peer := v.(*HotPeerStat); peer.HotDegree >= minHotDegree && !peer.inCold && peer.AntiCount == defaultAntiCount {
stat = append(stat, peer)
}
}
Expand Down

0 comments on commit 4c5eb07

Please sign in to comment.