Skip to content

Commit

Permalink
scheduler: fix inaccurate statistics and config (#3949) (#3966)
Browse files Browse the repository at this point in the history
* scheduler: simplify pending influence (#3658)

Signed-off-by: HunDunDM <hundundm@gmail.com>

* schedulers: unify the use and GC of hot-region's pendings and regionPendings (#3921)

Signed-off-by: HunDunDM <hundundm@gmail.com>

* scheduler: remove the useless code in hot-region-scheduler (#3833)

Signed-off-by: HunDunDM <hundundm@gmail.com>

* scheduler: fix inaccurate statistics and config (#3949)

Signed-off-by: HunDunDM <hundundm@gmail.com>

Co-authored-by: HunDunDM <hundundm@gmail.com>
  • Loading branch information
ti-chi-bot and HunDunDM authored Sep 9, 2021
1 parent 99e700e commit 605dc23
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 150 deletions.
12 changes: 12 additions & 0 deletions server/schedule/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ func (o *Operator) Status() OpStatus {
return o.status.Status()
}

// CheckAndGetStatus returns operator status after `CheckExpired` and `CheckTimeout`.
func (o *Operator) CheckAndGetStatus() OpStatus {
switch {
case o.CheckExpired():
return EXPIRED
case o.CheckTimeout():
return TIMEOUT
default:
return o.Status()
}
}

// GetReachTimeOf returns the time when operator reaches the given status.
func (o *Operator) GetReachTimeOf(st OpStatus) time.Time {
return o.status.ReachTimeOf(st)
Expand Down
Loading

0 comments on commit 605dc23

Please sign in to comment.