0
),
workerNodes: this.workerNodes.length,
+ ...(this.type === PoolTypes.dynamic && {
+ dynamicWorkerNodes: this.workerNodes.reduce(
+ (accumulator, workerNode) =>
+ workerNode.info.dynamic ? accumulator + 1 : accumulator,
+ 0
+ ),
+ }),
...(this.opts.enableTasksQueue === true && {
backPressure: this.backPressure,
backPressureWorkerNodes: this.workerNodes.reduce(
expect(pool.info).toStrictEqual({
busyWorkerNodes: 0,
defaultStrategy: WorkerChoiceStrategies.ROUND_ROBIN,
+ dynamicWorkerNodes: 0,
executedTasks: 0,
executingTasks: 0,
failedTasks: 0,
expect(pool.emitter.eventNames()).toStrictEqual([PoolEvents.ready])
expect(poolReady).toBe(1)
expect(poolInfo).toStrictEqual({
- busyWorkerNodes: expect.any(Number),
+ busyWorkerNodes: 0,
defaultStrategy: WorkerChoiceStrategies.ROUND_ROBIN,
- executedTasks: expect.any(Number),
- executingTasks: expect.any(Number),
- failedTasks: expect.any(Number),
- idleWorkerNodes: expect.any(Number),
+ dynamicWorkerNodes: 0,
+ executedTasks: 0,
+ executingTasks: 0,
+ failedTasks: 0,
+ idleWorkerNodes: Math.floor(numberOfWorkers / 2),
maxSize: numberOfWorkers,
minSize: Math.floor(numberOfWorkers / 2),
ready: true,
expect(poolFullInfo).toStrictEqual({
busyWorkerNodes: expect.any(Number),
defaultStrategy: WorkerChoiceStrategies.ROUND_ROBIN,
+ dynamicWorkerNodes: Math.floor(numberOfWorkers / 2),
executedTasks: expect.any(Number),
executingTasks: expect.any(Number),
failedTasks: expect.any(Number),
expect(poolFullEndInfo).toStrictEqual({
busyWorkerNodes: expect.any(Number),
defaultStrategy: WorkerChoiceStrategies.ROUND_ROBIN,
+ dynamicWorkerNodes: 0,
executedTasks: expect.any(Number),
executingTasks: expect.any(Number),
failedTasks: expect.any(Number),
expect(poolInfo).toStrictEqual({
busyWorkerNodes: 0,
defaultStrategy: WorkerChoiceStrategies.ROUND_ROBIN,
+ dynamicWorkerNodes: 0,
executedTasks: expect.any(Number),
executingTasks: expect.any(Number),
failedTasks: expect.any(Number),