pub struct PoolMetrics {
pub acquisition_waits: AtomicUsize,
pub acquisition_cancellations: AtomicUsize,
}Expand description
Observable metrics for the connection pool.
All counters are atomically updated and may be read concurrently.
§What is measured
These counters track logical permits held by the pool, not raw TCP sockets or HTTP/2 streams. Hyper owns socket lifecycle and h2 stream multiplexing; eggfetch cannot observe individual socket open/reuse/close events or per-connection stream counts through its current integration.
Under HTTP/2, a single TCP connection may carry multiple concurrent
streams, but the pool still tracks one permit per logical request.
The server’s SETTINGS_MAX_CONCURRENT_STREAMS limit is enforced
internally by hyper/h2, not by this pool. If the stream limit is
reached, hyper queues new streams, which may cause pool acquisition
to wait even though logical permit slots are available.
If you need socket-level or stream-level metrics, those would have to be added at a custom connector layer or by instrumenting h2 directly.
Fields§
§acquisition_waits: AtomicUsizeTotal number of times an acquire call had to wait for a permit.
acquisition_cancellations: AtomicUsizeTotal number of times an acquire call was cancelled while waiting.