Add average task wait time to worker pool metrics #65
Labels
No labels
Epic
Feature Request
HOLD
audit
automerge
bug
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
release
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
NiXTheDev/regexYbot#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Track the average time tasks spend waiting in the queue before being assigned to a worker. This helps detect contention and informs scaling decisions (e.g., increasing
WORKER_POOL_MAX_WORKERS).Implementation
Update
workerPool.ts– Modify therun()method to:enqueueTime).assignTaskToWorker()), calculate wait time =assignTime - enqueueTime.Maintain rolling average – Keep a simple moving average of wait times over a configurable window (e.g., last 100 tasks).
Update
getStats()andgetWorkerDetails()– Include:avgQueueWaitMs: number– Average wait time in milliseconds.maxQueueWaitMs: number– Peak wait time since start (optional).Update
metrics.ts– Display these in/metrics:Notes