-import type { EventLoopUtilization } from 'node:perf_hooks'
import type { CircularArray } from '../circular-array'
import type { Queue } from '../queue'
}
/**
- * Measure statistics.
+ * Measurement statistics.
*
* @internal
*/
-export interface MeasureStatistics {
+export interface MeasurementStatistics {
/**
- * Measure aggregation.
+ * Measurement aggregate.
*/
- aggregation: number
+ aggregate: number
/**
- * Measure average.
+ * Measurement average.
*/
average: number
/**
- * Measure median.
+ * Measurement median.
*/
median: number
/**
- * Measure history.
+ * Measurement history.
*/
history: CircularArray<number>
}
/**
- * Task statistics.
+ * Event loop utilization measurement statistics.
*
* @internal
*/
+export interface EventLoopUtilizationMeasurementStatistics {
+ idle: MeasurementStatistics
+ active: MeasurementStatistics
+ utilization: number
+}
+/**
+ * Task statistics.
+ *
+ * @internal
+ */
export interface TaskStatistics {
/**
- * Number of tasks executed.
+ * Number of executed tasks.
*/
executed: number
/**
- * Number of tasks executing.
+ * Number of executing tasks.
*/
executing: number
/**
- * Number of tasks queued.
+ * Number of queued tasks.
*/
- queued: number
+ readonly queued: number
/**
- * Number of tasks failed.
+ * Number of failed tasks.
*/
failed: number
}
/**
* Tasks runtime statistics.
*/
- runTime: MeasureStatistics
+ runTime: MeasurementStatistics
/**
* Tasks wait time statistics.
*/
- waitTime: MeasureStatistics
+ waitTime: MeasurementStatistics
/**
- * Event loop utilization.
+ * Tasks event loop utilization statistics.
*/
- elu: EventLoopUtilization | undefined
+ elu: EventLoopUtilizationMeasurementStatistics
}
/**