accumulator + workerNode.usage.tasks.executing,
0
),
- queuedTasks: this.workerNodes.reduce(
- (accumulator, workerNode) =>
- accumulator + workerNode.usage.tasks.queued,
- 0
- ),
- maxQueuedTasks: this.workerNodes.reduce(
- (accumulator, workerNode) =>
- accumulator + (workerNode.usage.tasks?.maxQueued ?? 0),
- 0
- ),
+ ...(this.opts.enableTasksQueue === true && {
+ queuedTasks: this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ accumulator + workerNode.usage.tasks.queued,
+ 0
+ )
+ }),
+ ...(this.opts.enableTasksQueue === true && {
+ maxQueuedTasks: this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ accumulator + (workerNode.usage.tasks?.maxQueued ?? 0),
+ 0
+ )
+ }),
failedTasks: this.workerNodes.reduce(
(accumulator, workerNode) =>
accumulator + workerNode.usage.tasks.failed,
readonly busyWorkerNodes: number
readonly executedTasks: number
readonly executingTasks: number
- readonly queuedTasks: number
- readonly maxQueuedTasks: number
+ readonly queuedTasks?: number
+ readonly maxQueuedTasks?: number
readonly failedTasks: number
readonly runTime?: {
readonly minimum: number
busyWorkerNodes: 0,
executedTasks: 0,
executingTasks: 0,
- queuedTasks: 0,
- maxQueuedTasks: 0,
failedTasks: 0
})
await pool.destroy()
busyWorkerNodes: 0,
executedTasks: 0,
executingTasks: 0,
- queuedTasks: 0,
- maxQueuedTasks: 0,
failedTasks: 0
})
await pool.destroy()
busyWorkerNodes: expect.any(Number),
executedTasks: expect.any(Number),
executingTasks: expect.any(Number),
- queuedTasks: expect.any(Number),
- maxQueuedTasks: expect.any(Number),
failedTasks: expect.any(Number)
})
await pool.destroy()
busyWorkerNodes: expect.any(Number),
executedTasks: expect.any(Number),
executingTasks: expect.any(Number),
- queuedTasks: expect.any(Number),
- maxQueuedTasks: expect.any(Number),
failedTasks: expect.any(Number)
})
await pool.destroy()
busyWorkerNodes: expect.any(Number),
executedTasks: expect.any(Number),
executingTasks: expect.any(Number),
- queuedTasks: expect.any(Number),
- maxQueuedTasks: expect.any(Number),
failedTasks: expect.any(Number)
})
await pool.destroy()