Expand description
Worker-pool saturation metrics for the shared TCP server (backend side).
These metrics expose queue buildup between work_tx.send() and dispatcher
pickup, and permit starvation in the bounded worker pool.
Statics§
- ENGINE_
REQUEST_ GAUGE - Requests currently in the engine (worker-pool permits in use). Driven from
ActiveTaskGuard, alongsideWORK_HANDLER_POOL_ACTIVE_TASKS. - REJECTION_
REQUEST_ TOTAL - Requests shed because the worker was at capacity: all engine in-flight slots
(
--engine-request-limit) held AND the overflow queue (--dynamo-request-queue-limit) full. - REQUEST_
QUEUE_ GAUGE - Requests queued in Dynamo but not yet in the engine. Driven alongside
WORK_HANDLER_QUEUE_DEPTH(inc on enqueue, dec on dispatcher recv). - WORK_
HANDLER_ ENQUEUE_ REJECTED_ TOTAL - Times enqueuing work failed because the dispatcher channel was closed
(receiver gone). A full queue is a rejection, counted by
REJECTION_REQUEST_TOTAL, not here. - WORK_
HANDLER_ PERMIT_ WAIT_ SECONDS - Time spent waiting to acquire a worker-pool permit. Normal operation is sub-millisecond; saturation pushes p99 into seconds.
- WORK_
HANDLER_ POOL_ ACTIVE_ TASKS - Current number of active worker-pool tasks (permits in use).
- WORK_
HANDLER_ POOL_ CAPACITY - Configured worker-pool capacity (total permits). Static; set once at server init.
- WORK_
HANDLER_ QUEUE_ CAPACITY - Configured capacity of the bounded work queue. Static; set once at server init.
- WORK_
HANDLER_ QUEUE_ DEPTH - Current items sitting in the bounded mpsc work queue awaiting dispatcher
pickup. Incremented on successful
work_tx.send()and decremented immediately afterwork_rx.recv(). Permit-acquire wait is NOT counted here — seeWORK_HANDLER_PERMIT_WAIT_SECONDS.
Functions§
- ensure_
work_ handler_ pool_ metrics_ registered - Register worker-pool saturation metrics with the given registry. Idempotent.