### 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
- `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 }`
}
/**
- * 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
*/
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
*/
*/
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
/**
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,
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,
)
})
- 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,