X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fworker.ts;h=598e6be82ca22588c34f04d6a0c402359956b66d;hb=4134429293801daed1762d927f66cee979de8864;hp=b6dddd1d59ac24916dd8ab49591dc31c1edfa93a;hpb=8604aaabd5aef29ed9b824a2d1dcdb53490ea8ad;p=poolifier.git diff --git a/src/pools/worker.ts b/src/pools/worker.ts index b6dddd1d..598e6be8 100644 --- a/src/pools/worker.ts +++ b/src/pools/worker.ts @@ -1,4 +1,3 @@ -import type { EventLoopUtilization } from 'node:perf_hooks' import type { CircularArray } from '../circular-array' import type { Queue } from '../queue' @@ -63,9 +62,9 @@ export interface Task { */ export interface MeasurementStatistics { /** - * Measurement aggregation. + * Measurement aggregate. */ - aggregation: number + aggregate: number /** * Measurement average. */ @@ -80,6 +79,17 @@ export interface MeasurementStatistics { history: CircularArray } +/** + * Event loop utilization measurement statistics. + * + * @internal + */ +export interface EventLoopUtilizationMeasurementStatistics { + idle: MeasurementStatistics + active: MeasurementStatistics + utilization: number +} + /** * Task statistics. * @@ -87,19 +97,19 @@ export interface MeasurementStatistics { */ 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. */ readonly queued: number /** - * Number of tasks failed. + * Number of failed tasks. */ failed: number } @@ -123,9 +133,9 @@ export interface WorkerUsage { */ waitTime: MeasurementStatistics /** - * Event loop utilization. + * Tasks event loop utilization statistics. */ - elu: EventLoopUtilization | undefined + elu: EventLoopUtilizationMeasurementStatistics } /**