X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fworker.ts;h=598e6be82ca22588c34f04d6a0c402359956b66d;hb=e5536a06df85c554b8832f5fb5195b369258053b;hp=ba9393ab9ba8241e5f1a1184165d42055b859835;hpb=1dfe8965df029a366c040227fb61ae47b3d59a3a;p=poolifier.git diff --git a/src/pools/worker.ts b/src/pools/worker.ts index ba9393ab..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. */ - queued: number + 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 } /**