Replies: 1 comment 4 replies
-
Hiya! I like this question. 😀
We don't currently have a public API exposing this, but you can get it by digging into the implementation. (Make sure to strictly version-pin if you're doing this in live code!) All the handled requests are stored as state here... httpcore/httpcore/_async/connection_pool.py Line 106 in cad62bf The status has two attributes If
Connections are stored as state here... httpcore/httpcore/_async/connection_pool.py Line 105 in cad62bf A connection might either be idle (keep alive) or active. Active connections will only ever have one request for HTTP/1.1, but may have one or more requests for HTTP/2. The object
You'd need to figure that one out yourself. Something that would help would be if the httpcore/httpcore/_async/connection.py Lines 108 to 112 in cad62bf If you're interested in helping work on public API towards any of these as new features, I'd be very happy to help guide you through the process. |
Beta Was this translation helpful? Give feedback.
-
Hello!
Can you advise some way to monitor connection pool, specifically for the
AsyncClient
?What I would like to know is the following:
I could potentially get some numbers using existing
request
andresponse
hook, what I don't know is whenrequest
hook is fired - does it fire before connection is acquired or after - it's not very clear to me from the documentation. But this should be easy to check.Perhaps there could be added hooks into the connection pool or maybe someone from the community does this in a different way somehow already?
Beta Was this translation helpful? Give feedback.
All reactions