X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fworker.ts;h=598e6be82ca22588c34f04d6a0c402359956b66d;hb=4134429293801daed1762d927f66cee979de8864;hp=94f0ff73043d3d4eede636c9bcae5d0f21ee82e8;hpb=9a0613e995004ae9e2faa287a8dd92c2854141f1;p=poolifier.git diff --git a/src/pools/worker.ts b/src/pools/worker.ts index 94f0ff73..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. * @@ -123,9 +133,9 @@ export interface WorkerUsage { */ waitTime: MeasurementStatistics /** - * Event loop utilization. + * Tasks event loop utilization statistics. */ - elu: EventLoopUtilization | undefined + elu: EventLoopUtilizationMeasurementStatistics } /**