Skip to content

Commit

Permalink
tiny fix
Browse files Browse the repository at this point in the history
Signed-off-by: HunDunDM <[email protected]>
  • Loading branch information
HunDunDM committed Sep 15, 2021
1 parent a41a2d1 commit 421d622
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions server/schedulers/hot_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,18 +340,18 @@ func summaryStoresLoad(
}
}

expectLoads := make([]float64, len(allTiKVLoadSum))
for i := range expectLoads {
expectLoads[i] = allTiKVLoadSum[i] / float64(allTiKVCount)
}
expect := storeLoad{
Loads: expectLoads,
Count: float64(allTiKVHotPeersCount) / float64(allTiKVCount),
}

// store expectation byte/key rate and count for each store-load detail.
for id, detail := range loadDetail {
var allLoadSum = allTiKVLoadSum
var allStoreCount = float64(allTiKVCount)
var allHotPeersCount = float64(allTiKVHotPeersCount)
expectLoads := make([]float64, len(allLoadSum))
for i := range expectLoads {
expectLoads[i] = allLoadSum[i] / allStoreCount
}
expectCount := allHotPeersCount / allStoreCount
detail.LoadPred.Expect.Loads = expectLoads
detail.LoadPred.Expect.Count = expectCount
detail.LoadPred.Expect = expect
// Debug
{
ty := "exp-byte-rate-" + rwTy.String() + "-" + kind.String()
Expand All @@ -363,7 +363,7 @@ func summaryStoresLoad(
}
{
ty := "exp-count-rate-" + rwTy.String() + "-" + kind.String()
hotPeerSummary.WithLabelValues(ty, fmt.Sprintf("%v", id)).Set(expectCount)
hotPeerSummary.WithLabelValues(ty, fmt.Sprintf("%v", id)).Set(expect.Count)
}
}
return loadDetail
Expand Down

0 comments on commit 421d622

Please sign in to comment.