repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: cleanup queued tasks computation
[poolifier.git]
/
src
/
pools
/
worker.ts
diff --git
a/src/pools/worker.ts
b/src/pools/worker.ts
index b6dddd1d59ac24916dd8ab49591dc31c1edfa93a..598e6be82ca22588c34f04d6a0c402359956b66d 100644
(file)
--- 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'
import type { CircularArray } from '../circular-array'
import type { Queue } from '../queue'
@@
-63,9
+62,9
@@
export interface Task<Data = unknown> {
*/
export interface MeasurementStatistics {
/**
*/
export interface MeasurementStatistics {
/**
- * Measurement aggregat
ion
.
+ * Measurement aggregat
e
.
*/
*/
- aggregat
ion
: number
+ aggregat
e
: number
/**
* Measurement average.
*/
/**
* Measurement average.
*/
@@
-80,6
+79,17
@@
export interface MeasurementStatistics {
history: CircularArray<number>
}
history: CircularArray<number>
}
+/**
+ * Event loop utilization measurement statistics.
+ *
+ * @internal
+ */
+export interface EventLoopUtilizationMeasurementStatistics {
+ idle: MeasurementStatistics
+ active: MeasurementStatistics
+ utilization: number
+}
+
/**
* Task statistics.
*
/**
* Task statistics.
*
@@
-87,19
+97,19
@@
export interface MeasurementStatistics {
*/
export interface TaskStatistics {
/**
*/
export interface TaskStatistics {
/**
- * Number of
tasks executed
.
+ * Number of
executed tasks
.
*/
executed: number
/**
*/
executed: number
/**
- * Number of
tasks executing
.
+ * Number of
executing tasks
.
*/
executing: number
/**
*/
executing: number
/**
- * Number of
tasks queued
.
+ * Number of
queued tasks
.
*/
readonly queued: number
/**
*/
readonly queued: number
/**
- * Number of
tasks failed
.
+ * Number of
failed tasks
.
*/
failed: number
}
*/
failed: number
}
@@
-123,9
+133,9
@@
export interface WorkerUsage {
*/
waitTime: MeasurementStatistics
/**
*/
waitTime: MeasurementStatistics
/**
- *
Event loop utilization
.
+ *
Tasks event loop utilization statistics
.
*/
*/
- elu: EventLoopUtilization
| undefined
+ elu: EventLoopUtilization
MeasurementStatistics
}
/**
}
/**