build: disable esModuleInterop from TS configuration
[poolifier.git] / src / pools / worker.ts
index 664b6a7695ef42a088732812a7eac270e9f87a00..35853b7dcf427b8281d65b74399106707b930577 100644 (file)
@@ -65,6 +65,14 @@ export interface MeasurementStatistics {
    * Measurement aggregate.
    */
   aggregate: number
+  /**
+   * Measurement minimum.
+   */
+  minimum: number
+  /**
+   * Measurement maximum.
+   */
+  maximum: number
   /**
    * Measurement average.
    */
@@ -76,7 +84,7 @@ export interface MeasurementStatistics {
   /**
    * Measurement history.
    */
-  history: CircularArray<number>
+  readonly history: CircularArray<number>
 }
 
 /**
@@ -85,9 +93,9 @@ export interface MeasurementStatistics {
  * @internal
  */
 export interface EventLoopUtilizationMeasurementStatistics {
-  idle: MeasurementStatistics
-  active: MeasurementStatistics
-  utilization: number
+  readonly idle: MeasurementStatistics
+  readonly active: MeasurementStatistics
+  utilization?: number
 }
 
 /**
@@ -127,7 +135,11 @@ export interface WorkerInfo {
   /**
    * Worker id.
    */
-  id: number | undefined
+  readonly id: number | undefined
+  /**
+   * Dynamic flag.
+   */
+  dynamic: boolean
   /**
    * Started flag.
    */
@@ -143,19 +155,19 @@ export interface WorkerUsage {
   /**
    * Tasks statistics.
    */
-  tasks: TaskStatistics
+  readonly tasks: TaskStatistics
   /**
    * Tasks runtime statistics.
    */
-  runTime: MeasurementStatistics
+  readonly runTime: MeasurementStatistics
   /**
    * Tasks wait time statistics.
    */
-  waitTime: MeasurementStatistics
+  readonly waitTime: MeasurementStatistics
   /**
    * Tasks event loop utilization statistics.
    */
-  elu: EventLoopUtilizationMeasurementStatistics
+  readonly elu: EventLoopUtilizationMeasurementStatistics
 }
 
 /**
@@ -201,7 +213,7 @@ export interface WorkerNode<Worker extends IWorker, Data = unknown> {
   /**
    * Worker node worker info.
    */
-  info: WorkerInfo
+  readonly info: WorkerInfo
   /**
    * Worker node worker usage statistics.
    */