nemo_gym.telemetry.connection_pool
nemo_gym.telemetry.connection_pool
aiohttp connection-pool capacity diagnostics and queue-wait metrics.
Module Contents
Classes
Functions
Data
API
Bases: NamedTuple
Per-process connector limits and demand after division across workers.
workers is the size of one server’s FastAPI process group, or one for the CLI.
Positive total and per_host limits are rounded down; zero means explicitly
unlimited. per_host is the divided configured value, before a finite total
constrains effective per-host capacity.
intended and intended_per_host are expected demand rounded up per worker,
or None when the corresponding estimate is not configured.
Connector budgets and optional demand estimates for one server or rollout CLI.
Configured limits apply to one server process group before division across its
FastAPI workers, not the whole deployment. An explicit limit of zero is unlimited.
Intended concurrency is optional expected outbound demand for that same group;
None disables the corresponding sizing check.
Bases: TCPConnector
TCPConnector that measures how long connections wait for a free pool slot.
Every connect() call increments connect_total for the current destination.
Each queued acquisition records one queue_duration_ms sample.
The sample is labelled with the limit that was binding when the wait started.
The wait is timed by overriding aiohttp’s private _wait_for_available_connection.
test_queue_wait_override_matches_aiohttp_signature fails if aiohttp changes that method.
Classify the binding connector limit when aiohttp reports a queue wait.
Return Linux’s approximate per-destination ephemeral-port budget when available.
Build the timed connector only while this process exports metrics.
Calculate aiohttp limits for one process, preserving explicit unlimited values.
Report one server/CLI process group’s pool sizing and unsafe capacity mismatches.
Restore the caller’s destination label.
Set the bounded destination label while one logical request and its retries run.