Skip to content

Commit

Permalink
Merge pull request #103039 from tkashem/fix-102973
Browse files Browse the repository at this point in the history
apf: calculation of dR/dt should use seats in use
  • Loading branch information
k8s-ci-robot committed Jul 5, 2021
2 parents 120f632 + 6203d4f commit a3c2028
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,17 +413,17 @@ func (qs *queueSet) syncTimeLocked() {
// been advancing, according to the logic in `doc.go`.
func (qs *queueSet) getVirtualTimeRatioLocked() float64 {
activeQueues := 0
reqs := 0
seatsInUse := 0
for _, queue := range qs.queues {
reqs += queue.requestsExecuting
seatsInUse += queue.seatsInUse
if queue.requests.Length() > 0 || queue.requestsExecuting > 0 {
activeQueues++
}
}
if activeQueues == 0 {
return 0
}
return math.Min(float64(reqs), float64(qs.dCfg.ConcurrencyLimit)) / float64(activeQueues)
return math.Min(float64(seatsInUse), float64(qs.dCfg.ConcurrencyLimit)) / float64(activeQueues)
}

// timeoutOldRequestsAndRejectOrEnqueueLocked encapsulates the logic required
Expand Down

0 comments on commit a3c2028

Please sign in to comment.