Add number in queue status to monitor page (#18712)

Add number in queue status to the monitor page so that administrators can
assess how much work is left to be done in the queues.

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lunny Xiao <[email protected]>
Co-authored-by: wxiaoguang <[email protected]>
This commit is contained in:
zeripath
2022-02-12 13:31:26 +08:00
committed by GitHub
co-authored by Lunny Xiao wxiaoguang
parent 9444135ff5
commit 4e57bd1d30
6 changed files with 27 additions and 0 deletions
+5
View File
@@ -204,6 +204,11 @@ func (p *WorkerPool) NumberOfWorkers() int {
return p.numberOfWorkers
}
// NumberInQueue returns the number of items in the queue
func (p *WorkerPool) NumberInQueue() int64 {
return atomic.LoadInt64(&p.numInQueue)
}
// MaxNumberOfWorkers returns the maximum number of workers automatically added to the pool
func (p *WorkerPool) MaxNumberOfWorkers() int {
p.lock.Lock()