Skip to content

Commit

Permalink
scheduler: fix inaccurate statistics and config (#3949) (#3964)
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>

* tiny fix

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

* tiny fix

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

Co-authored-by: HunDunDM <hundundm@gmail.com>
  • Loading branch information
ti-chi-bot and HunDunDM authored Sep 1, 2021
1 parent 7f6d57e commit b1adc27
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 163 deletions.
12 changes: 12 additions & 0 deletions server/schedule/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,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 b1adc27

Please sign in to comment.