From e6606302a2b7252f3135b5828ed766add1f65e99 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 29 May 2023 22:59:06 +0200 Subject: [PATCH] refactor: spell fixes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- CHANGELOG.md | 4 ++-- README.md | 2 +- .../abstract-worker-choice-strategy.ts | 8 ++++---- .../selection-strategies/selection-strategies-types.ts | 10 +++++----- .../selection-strategies/selection-strategies.test.js | 4 ++-- .../worker-choice-strategy-context.test.js | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5c05bb1..200e61dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -99,8 +99,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added -- Use monotonic high resolution timer for worker tasks run time. -- Add worker tasks median run time to statistics. +- Use monotonic high resolution timer for worker tasks runtime. +- Add worker tasks median runtime to statistics. - Add worker tasks queue (experimental). ## [2.4.4] - 2023-04-07 diff --git a/README.md b/README.md index 1b7e641b..3eeebed1 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ Node versions >= 16.14.x are supported. - `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 }` diff --git a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts index ad42f918..efa9578d 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -99,12 +99,12 @@ export abstract class AbstractWorkerChoiceStrategy< } /** - * 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. - * @returns The worker task run time. + * @returns The worker task runtime. */ protected getWorkerTaskRunTime (workerNodeKey: number): number { return this.requiredStatistics.medRunTime diff --git a/src/pools/selection-strategies/selection-strategies-types.ts b/src/pools/selection-strategies/selection-strategies-types.ts index 94e2d3e6..d132c877 100644 --- a/src/pools/selection-strategies/selection-strategies-types.ts +++ b/src/pools/selection-strategies/selection-strategies-types.ts @@ -34,13 +34,13 @@ export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies */ export interface WorkerChoiceStrategyOptions { /** - * Use tasks median run time instead of average run time. + * Use tasks median runtime instead of average runtime. * * @defaultValue false */ medRunTime?: boolean /** - * Use tasks median wait time instead of average run time. + * Use tasks median wait time instead of average runtime. * * @defaultValue false */ @@ -61,15 +61,15 @@ export interface WorkerChoiceStrategyOptions { */ export interface RequiredStatistics { /** - * Require tasks run time. + * Require tasks runtime. */ runTime: boolean /** - * Require tasks average run time. + * Require tasks average runtime. */ avgRunTime: boolean /** - * Require tasks median run time. + * Require tasks median runtime. */ medRunTime: boolean /** diff --git a/tests/pools/selection-strategies/selection-strategies.test.js b/tests/pools/selection-strategies/selection-strategies.test.js index 11a9aab3..33d2114c 100644 --- a/tests/pools/selection-strategies/selection-strategies.test.js +++ b/tests/pools/selection-strategies/selection-strategies.test.js @@ -466,7 +466,7 @@ describe('Selection strategies test suite', () => { await pool.destroy() }) - it('Verify FAIR_SHARE strategy can be run in a dynamic pool with median run time statistic', async () => { + it('Verify FAIR_SHARE strategy can be run in a dynamic pool with median runtime statistic', async () => { const pool = new DynamicThreadPool( min, max, @@ -671,7 +671,7 @@ describe('Selection strategies test suite', () => { await pool.destroy() }) - it('Verify WEIGHTED_ROUND_ROBIN strategy can be run in a dynamic pool with median run time statistic', async () => { + it('Verify WEIGHTED_ROUND_ROBIN strategy can be run in a dynamic pool with median runtime statistic', async () => { const pool = new DynamicThreadPool( min, max, diff --git a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js index f04013d9..fa380a5a 100644 --- a/tests/pools/selection-strategies/worker-choice-strategy-context.test.js +++ b/tests/pools/selection-strategies/worker-choice-strategy-context.test.js @@ -322,7 +322,7 @@ describe('Worker choice strategy context test suite', () => { ) }) - 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, -- 2.34.1