summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
dab8c37)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
-Node versions >= 16.x are supported.
+Node versions >= 16.14.x are supported.
## [API](https://poolifier.github.io/poolifier/)
## [API](https://poolifier.github.io/poolifier/)
- `workerChoiceStrategyOptions` (optional) - The worker choice strategy options object to use in this pool.
Properties:
- `workerChoiceStrategyOptions` (optional) - The worker choice strategy options object to use in this pool.
Properties:
- - `medRunTime` (optional) - Use the tasks median run time instead of the tasks average run time in worker choice strategies.
+ - `medRunTime` (optional) - Use the tasks median runtime instead of the tasks average runtime in worker choice strategies.
- `weights` (optional) - The worker weights to use in the weighted round robin worker choice strategy: `{ 0: 200, 1: 300, ..., n: 100 }`
Default: `{ medRunTime: false }`
- `weights` (optional) - The worker weights to use in the weighted round robin worker choice strategy: `{ 0: 200, 1: 300, ..., n: 100 }`
Default: `{ medRunTime: false }`
"main": "index.js",
"author": "pioardi",
"engines": {
"main": "index.js",
"author": "pioardi",
"engines": {
"pnpm": ">=8.6.0"
},
"volta": {
"pnpm": ">=8.6.0"
},
"volta": {
"pnpm": ">=8.6.0"
},
"volta": {
"pnpm": ">=8.6.0"
},
"volta": {
-import EventEmitter from 'node:events'
+import EventEmitterAsyncResource from 'node:events'
import type {
ErrorHandler,
ExitHandler,
import type {
ErrorHandler,
ExitHandler,
/**
* Pool events emitter.
*/
/**
* Pool events emitter.
*/
-export class PoolEmitter extends EventEmitter {}
+export class PoolEmitter extends EventEmitterAsyncResource {}
/**
* Enumeration of pool events.
/**
* Enumeration of pool events.
- * Gets the worker task run time.
- * If the required statistics are `avgRunTime`, the average run time is returned.
- * If the required statistics are `medRunTime`, the median run time is returned.
+ * Gets the worker task runtime.
+ * If the required statistics are `avgRunTime`, the average runtime is returned.
+ * If the required statistics are `medRunTime`, the median runtime is returned.
*
* @param workerNodeKey - The worker node key.
*
* @param workerNodeKey - The worker node key.
- * @returns The worker task run time.
+ * @returns The worker task runtime.
*/
protected getWorkerTaskRunTime (workerNodeKey: number): number {
return this.requiredStatistics.medRunTime
*/
protected getWorkerTaskRunTime (workerNodeKey: number): number {
return this.requiredStatistics.medRunTime
*/
export interface WorkerChoiceStrategyOptions {
/**
*/
export interface WorkerChoiceStrategyOptions {
/**
- * Use tasks median run time instead of average run time.
+ * Use tasks median runtime instead of average runtime.
*
* @defaultValue false
*/
*
* @defaultValue false
*/
- it('Verify that worker choice strategy options enable median run time pool statistics', () => {
+ it('Verify that worker choice strategy options enable median runtime pool statistics', () => {
const wwrWorkerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
let workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool,
const wwrWorkerChoiceStrategy = WorkerChoiceStrategies.WEIGHTED_ROUND_ROBIN
let workerChoiceStrategyContext = new WorkerChoiceStrategyContext(
fixedPool,