repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into elu-strategy
[poolifier.git]
/
src
/
pools
/
selection-strategies
/
selection-strategies-types.ts
diff --git
a/src/pools/selection-strategies/selection-strategies-types.ts
b/src/pools/selection-strategies/selection-strategies-types.ts
index c90036fe6f269dd7757482064a3fdba0b7a97e97..0fbb4d4d43165737d3bd3c0c7378b2c55d7e03d2 100644
(file)
--- a/
src/pools/selection-strategies/selection-strategies-types.ts
+++ b/
src/pools/selection-strategies/selection-strategies-types.ts
@@
-14,6
+14,12
@@
export const WorkerChoiceStrategies = Object.freeze({
* Least busy worker selection strategy.
*/
LEAST_BUSY: 'LEAST_BUSY',
* Least busy worker selection strategy.
*/
LEAST_BUSY: 'LEAST_BUSY',
+ /**
+ * Least ELU worker selection strategy.
+ *
+ * @experimental
+ */
+ LEAST_ELU: 'LEAST_ELU',
/**
* Fair share worker selection strategy.
*/
/**
* Fair share worker selection strategy.
*/
@@
-21,7
+27,13
@@
export const WorkerChoiceStrategies = Object.freeze({
/**
* Weighted round robin worker selection strategy.
*/
/**
* Weighted round robin worker selection strategy.
*/
- WEIGHTED_ROUND_ROBIN: 'WEIGHTED_ROUND_ROBIN'
+ WEIGHTED_ROUND_ROBIN: 'WEIGHTED_ROUND_ROBIN',
+ /**
+ * Interleaved weighted round robin worker selection strategy.
+ *
+ * @experimental
+ */
+ INTERLEAVED_WEIGHTED_ROUND_ROBIN: 'INTERLEAVED_WEIGHTED_ROUND_ROBIN'
} as const)
/**
} as const)
/**
@@
-29,22
+41,32
@@
export const WorkerChoiceStrategies = Object.freeze({
*/
export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies
*/
export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies
+/**
+ * Measurement options.
+ */
+interface MeasurementOptions {
+ /**
+ * Set measurement median.
+ */
+ median: boolean
+}
+
/**
* Worker choice strategy options.
*/
export interface WorkerChoiceStrategyOptions {
/**
/**
* Worker choice strategy options.
*/
export interface WorkerChoiceStrategyOptions {
/**
- *
Use tasks median runtime instead of average runtime
.
+ *
Runtime options
.
*
*
- * @defaultValue
false
+ * @defaultValue
\{ median: false \}
*/
*/
- medRunTime?: boolean
+ runTime?: MeasurementOptions
/**
/**
- *
Use tasks median wait time instead of average runtime
.
+ *
Wait time options
.
*
*
- * @defaultValue
false
+ * @defaultValue
\{ median: false \}
*/
*/
- medWaitTime?: boolean
+ waitTime?: MeasurementOptions
/**
* Worker weights to use for weighted round robin worker selection strategy.
* Weight is the tasks maximum average or median runtime in milliseconds.
/**
* Worker weights to use for weighted round robin worker selection strategy.
* Weight is the tasks maximum average or median runtime in milliseconds.
@@
-55,35
+77,43
@@
export interface WorkerChoiceStrategyOptions {
}
/**
}
/**
- *
Pool worker tasks usage
statistics requirements.
+ *
Measurement
statistics requirements.
*
* @internal
*/
*
* @internal
*/
-
export interface RequiredStatistic
s {
+
interface MeasurementStatisticsRequirement
s {
/**
/**
- * Require
tasks runtim
e.
+ * Require
measurement aggregat
e.
*/
*/
-
runTim
e: boolean
+
aggregat
e: boolean
/**
/**
- * Require
tasks average runtim
e.
+ * Require
measurement averag
e.
*/
*/
- av
gRunTim
e: boolean
+ av
erag
e: boolean
/**
/**
- * Require
tasks median runtime
.
+ * Require
measurement median
.
*/
*/
- medRunTime: boolean
+ median: boolean
+}
+
+/**
+ * Pool worker node worker usage statistics requirements.
+ *
+ * @internal
+ */
+export interface TaskStatisticsRequirements {
/**
/**
- *
Require tasks wait time
.
+ *
Tasks runtime requirements
.
*/
*/
- waitTime: boolean
+ runTime: MeasurementStatisticsRequirements
/**
/**
- *
Require tasks average wait time
.
+ *
Tasks wait time requirements
.
*/
*/
- avgWaitTime: boolean
+ waitTime: MeasurementStatisticsRequirements
/**
/**
- *
Require tasks median wait time
.
+ *
Event loop utilization
.
*/
*/
-
medWaitTime
: boolean
+
elu
: boolean
}
/**
}
/**
@@
-91,9
+121,9
@@
export interface RequiredStatistics {
*/
export interface IWorkerChoiceStrategy {
/**
*/
export interface IWorkerChoiceStrategy {
/**
- *
Required tasks usage statistic
s.
+ *
Tasks statistics requirement
s.
*/
*/
- readonly
requiredStatistics: RequiredStatistic
s
+ readonly
taskStatisticsRequirements: TaskStatisticsRequirement
s
/**
* Resets strategy internals.
*
/**
* Resets strategy internals.
*