Uh oh!
There was an error while loading. Please reload this page.
Add connection pool get_connection_stats method - #102
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Okay, great! So I'd been thinking about this one for a while actually. Something that we do want from this is to provide a useful level of structured debugging info. Something that we don't want is to introduce API that starts exposing internal implementation details. I was wondering if perhaps we should shift to something like this...
Where the Perhaps also Eg. {
(b'https', b'example.org', 443): ["HTTP/2, 3 active streams"],
(b'https', b'tomchristie.com', 443): ["HTTP/1.1, idle keep-alive", "HTTP/1.1, active", "HTTP/1.1, active"],
(b'https', google.com', 443): ["Connecting"],
}It's more verbose, but it doesn't start leaking implementation details, since we can document the strings as "opaque, don't rely on the format of this" but descriptive strings. |
yeraydiazdiaz
commented
May 28, 2020
I agree with leaking implementation details, which is why I added not the actual enum class but the name. Formalizing your suggestion strings a bit:
I don't think Also, do we want to keep the origin as a 3-tuple? |
yeraydiazdiaz
commented
May 28, 2020
Oh, and 👍 on |
lovelydinosaur
commented
May 28, 2020
Erm, good point. Nope, let's have it as a plain string.
Yup sounds fantastic. While we're connecting we don't yet have an HTTP version, so we've got a "Connecting" case too. We probably want a |
lovelydinosaur
commented
May 28, 2020
So, something like this, then?... {
"https://example.org:443": ["HTTP/2, ACTIVE, 3 streams"],
"https://tomchristie.com:443": ["HTTP/1.1, IDLE", "HTTP/1.1, ACTIVE", "HTTP/1.1, ACTIVE"],
"https://google.com:443": ["Connecting"],
} |
yeraydiazdiaz
commented
May 28, 2020
Yup, sounds good. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
LGTM
Are there any tests we can update to use this instead of private API?
Refs #18 (comment) :
Noticable in particular in the test cases which happen to reach inside intended-private API in order to deteremine the connection state
Uh oh!
There was an error while loading. Please reload this page.
880b9af to
e2740c5Compareyeraydiazdiaz
commented
Jun 6, 2020
It did in the first iteration of this PR, but since we're using now a string summary I decided to not to assert on the result of the new method to make things clearer. |
yeraydiazdiaz
commented
Jun 7, 2020
Thanks for the reviews @florimondmanca and @cansarigol 🙏 |
lovelydinosaur
commented
Jun 8, 2020
Fantastic stuff! Love it. 👍
Actually I do still think we should update the test cases. It's okay for us to document that the specific format shouldn't be relied upon, and could be subject to change, while still asserting against it ourselves in test cases. I'd probably suggest...
|
Closes#18