Skip to content

Commit

Permalink
Polish codes.
Browse files Browse the repository at this point in the history
Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
  • Loading branch information
LykxSassinator committed Nov 10, 2023
1 parent 3a9b536 commit 66b32c8
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions pkg/schedule/schedulers/evict_slow_trend.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ const (
alterEpsilon = 1e-9
minReCheckDurationGap = 120 // default gap for re-check the slow node, unit: s
defaultRecoveryDurationGap = 600 // default gap for recovery, unit: s.

// Use minimal interval of store heartbeat as interval.
minSlowTrendScheduleInterval = time.Second
// Use default interval of store heartbeat as default.
maxSlowTrendScheduleInterval = 10 * time.Second
)

type slowCandidate struct {
Expand Down Expand Up @@ -246,10 +241,6 @@ type evictSlowTrendScheduler struct {
handler http.Handler
}

func (s *evictSlowTrendScheduler) GetMinInterval() time.Duration {
return minSlowTrendScheduleInterval
}

func (s *evictSlowTrendScheduler) GetNextInterval(interval time.Duration) time.Duration {
var growthType intervalGrowthType
// If it already found a slow node as candidate, the next interval should be shorter
Expand All @@ -260,7 +251,7 @@ func (s *evictSlowTrendScheduler) GetNextInterval(interval time.Duration) time.D
} else {
growthType = exponentialGrowth
}
return intervalGrow(s.GetMinInterval(), maxSlowTrendScheduleInterval, growthType)
return intervalGrow(s.GetMinInterval(), MaxScheduleInterval, growthType)
}

func (s *evictSlowTrendScheduler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit 66b32c8

Please sign in to comment.