test: add tests for worker choice strategies using median run time
[poolifier.git] / src / pools / selection-strategies / selection-strategies-types.ts
index f5f06a6ef6afece164a4367a3026fc6db679adc3..065b310fa5e8a3454f84d5b0edd6324c7c2d0520 100644 (file)
@@ -29,12 +29,33 @@ export const WorkerChoiceStrategies = Object.freeze({
  */
 export type WorkerChoiceStrategy = keyof typeof WorkerChoiceStrategies
 
+/**
+ * Worker choice strategy options.
+ */
+export interface WorkerChoiceStrategyOptions {
+  /**
+   * Use tasks median run time instead of average run time.
+   */
+  medRunTime?: boolean
+}
+
 /**
  * Pool worker tasks usage statistics requirements.
+ *
+ * @internal
  */
 export interface RequiredStatistics {
+  /**
+   * Require tasks run time.
+   */
   runTime: boolean
+  /**
+   * Require tasks average run time.
+   */
   avgRunTime: boolean
+  /**
+   * Require tasks median run time.
+   */
   medRunTime: boolean
 }