import { cpus } from 'node:os'
-import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
+import {
+ DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
+ DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+} from '../../utils'
import type { IPool } from '../pool'
import type { IWorker } from '../worker'
import type {
/** @inheritDoc */
public readonly taskStatisticsRequirements: TaskStatisticsRequirements = {
- runTime: {
- aggregate: false,
- average: false,
- median: false
- },
- waitTime: {
- aggregate: false,
- average: false,
- median: false
- },
- elu: {
- aggregate: false,
- average: false,
- median: false
- }
+ runTime: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
+ waitTime: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
+ elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS
}
/**
-import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
+import {
+ DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
+ DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+} from '../../utils'
import type { IPool } from '../pool'
import type { IWorker } from '../worker'
import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
average: true,
median: false
},
- waitTime: {
- aggregate: false,
- average: false,
- median: false
- },
+ waitTime: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
elu: {
aggregate: true,
average: true,
-import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
+import {
+ DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
+ DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+} from '../../utils'
import type { IPool } from '../pool'
import type { IWorker } from '../worker'
import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
average: false,
median: false
},
- elu: {
- aggregate: false,
- average: false,
- median: false
- }
+ elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS
}
/** @inheritDoc */
-import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
+import {
+ DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
+ DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+} from '../../utils'
import type { IPool } from '../pool'
import type { IWorker } from '../worker'
import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
implements IWorkerChoiceStrategy {
/** @inheritDoc */
public readonly taskStatisticsRequirements: TaskStatisticsRequirements = {
- runTime: {
- aggregate: false,
- average: false,
- median: false
- },
- waitTime: {
- aggregate: false,
- average: false,
- median: false
- },
+ runTime: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
+ waitTime: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
elu: {
aggregate: true,
average: false,
import type { IWorker } from '../worker'
import type { IPool } from '../pool'
-import { DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS } from '../../utils'
+import {
+ DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
+ DEFAULT_WORKER_CHOICE_STRATEGY_OPTIONS
+} from '../../utils'
import { AbstractWorkerChoiceStrategy } from './abstract-worker-choice-strategy'
import type {
IWorkerChoiceStrategy,
average: true,
median: false
},
- waitTime: {
- aggregate: false,
- average: false,
- median: false
- },
- elu: {
- aggregate: false,
- average: false,
- median: false
- }
+ waitTime: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS,
+ elu: DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS
}
/**
-import type { WorkerChoiceStrategyOptions } from './pools/selection-strategies/selection-strategies-types'
+import type {
+ MeasurementStatisticsRequirements,
+ WorkerChoiceStrategyOptions
+} from './pools/selection-strategies/selection-strategies-types'
/**
* An intentional empty function.
elu: { median: false }
}
+/**
+ * Default measurement statistics requirements.
+ */
+export const DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS: MeasurementStatisticsRequirements =
+ {
+ aggregate: false,
+ average: false,
+ median: false
+ }
+
/**
* Compute the median of the given data set.
*