+ public get info (): PoolInfo {
+ return {
+ type: this.type,
+ worker: this.worker,
+ minSize: this.minSize,
+ maxSize: this.maxSize,
+ workerNodes: this.workerNodes.length,
+ idleWorkerNodes: this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ workerNode.workerUsage.tasks.executing === 0
+ ? accumulator + 1
+ : accumulator,
+ 0
+ ),
+ busyWorkerNodes: this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ workerNode.workerUsage.tasks.executing > 0
+ ? accumulator + 1
+ : accumulator,
+ 0
+ ),
+ executedTasks: this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ accumulator + workerNode.workerUsage.tasks.executed,
+ 0
+ ),
+ executingTasks: this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ accumulator + workerNode.workerUsage.tasks.executing,
+ 0
+ ),
+ queuedTasks: this.workerNodes.reduce(
+ (accumulator, workerNode) => accumulator + workerNode.tasksQueue.size,
+ 0
+ ),
+ maxQueuedTasks: this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ accumulator + workerNode.tasksQueue.maxSize,
+ 0
+ ),
+ failedTasks: this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ accumulator + workerNode.workerUsage.tasks.failed,
+ 0
+ )
+ }
+ }