Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
Signed-off-by: HunDunDM <[email protected]>
  • Loading branch information
HunDunDM committed Jul 27, 2021
1 parent 6a7e679 commit a632247
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions server/schedulers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,10 @@ func (s *storeInfo) addInfluence(infl *Influence, w float64) {
return
}
if s.PendingSum == nil {
s.PendingSum = new(Influence)
s.PendingSum.Loads = make([]float64, len(infl.Loads))
s.PendingSum = &Influence{
Loads: make([]float64, len(infl.Loads)),
Count: 0,
}
}
for i, load := range infl.Loads {
s.PendingSum.Loads[i] += load * w
Expand Down Expand Up @@ -514,12 +516,6 @@ func summaryStoresLoad(
}
loads[statistics.QueryDim] = storeLoads[statistics.StoreWriteQuery]
}
if !isTiFlash {
// The TiFlash flow is isolated from TiKV, so it is not counted in the sum.
for i := range allLoadSum {
allLoadSum[i] += loads[i]
}
}

// Find all hot peers first
var hotPeers []*statistics.HotPeerStat
Expand Down Expand Up @@ -554,6 +550,13 @@ func summaryStoresLoad(
hotPeerSummary.WithLabelValues(ty, fmt.Sprintf("%v", id)).Set(peerLoadSum[statistics.QueryDim])
}
}

if !isTiFlash {
// The TiFlash flow is isolated from TiKV, so it is not counted in the sum.
for i := range allLoadSum {
allLoadSum[i] += loads[i]
}
}
allCount += float64(len(hotPeers))

// Build store load prediction from current load and pending influence.
Expand Down

0 comments on commit a632247

Please sign in to comment.