Skip to content

Commit

Permalink
AlterEpsilon => alterEpsilon
Browse files Browse the repository at this point in the history
Signed-off-by: Liu Cong <[email protected]>
  • Loading branch information
innerr committed Feb 3, 2023
1 parent 362862e commit a4935ef
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/schedulers/evict_slow_trend.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ func chooseEvictCandidate(cluster schedule.Cluster) (slowStore *core.StoreInfo)
continue
}
slowTrend := store.GetSlowTrend()
if slowTrend != nil && slowTrend.CauseRate > AlterEpsilon && slowTrend.ResultRate < -AlterEpsilon {
if slowTrend != nil && slowTrend.CauseRate > alterEpsilon && slowTrend.ResultRate < -alterEpsilon {
candidates = append(candidates, store)
storeSlowTrendActionStatusGauge.WithLabelValues("cand.add").Inc()
log.Info("evict-slow-trend-scheduler canptured candidate",
Expand All @@ -306,7 +306,7 @@ func chooseEvictCandidate(cluster schedule.Cluster) (slowStore *core.StoreInfo)
zap.Float64("cause-value", slowTrend.CauseValue),
zap.Float64("result-value", slowTrend.ResultValue))
}
if slowTrend != nil && slowTrend.ResultRate < -AlterEpsilon {
if slowTrend != nil && slowTrend.ResultRate < -alterEpsilon {
affectedStoreCount += 1
}
}
Expand Down Expand Up @@ -387,7 +387,7 @@ func checkStoreSlowerThanOthers(cluster schedule.Cluster, target *core.StoreInfo
slowTrend := store.GetSlowTrend()
// Use `SlowTrend.ResultValue` at first, but not good, `CauseValue` is better
// Greater `CuaseValue` means slower
if slowTrend != nil && (targetSlowTrend.CauseValue-slowTrend.CauseValue) > AlterEpsilon && slowTrend.CauseValue > AlterEpsilon {
if slowTrend != nil && (targetSlowTrend.CauseValue-slowTrend.CauseValue) > alterEpsilon && slowTrend.CauseValue > alterEpsilon {
slowerThanStoresNum += 1
}
}
Expand Down Expand Up @@ -441,7 +441,7 @@ func checkStoreFasterThanOthers(cluster schedule.Cluster, target *core.StoreInfo
slowTrend := store.GetSlowTrend()
// Greater `CuaseValue` means slower
if slowTrend != nil && targetSlowTrend.CauseValue <= slowTrend.CauseValue*1.1 &&
slowTrend.CauseValue > AlterEpsilon && targetSlowTrend.CauseValue > AlterEpsilon {
slowTrend.CauseValue > alterEpsilon && targetSlowTrend.CauseValue > alterEpsilon {
fasterThanStores += 1
}
}
Expand All @@ -450,4 +450,4 @@ func checkStoreFasterThanOthers(cluster schedule.Cluster, target *core.StoreInfo
return fasterThanStores > expected
}

const AlterEpsilon = 1e-9
const alterEpsilon = 1e-9

0 comments on commit a4935ef

Please sign in to comment.