Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add __repr__ for AsyncPoolManager #194

Open
owocado opened this issue Jan 12, 2025 · 2 comments
Open

Please add __repr__ for AsyncPoolManager #194

owocado opened this issue Jan 12, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@owocado
Copy link

owocado commented Jan 12, 2025

Context

What are you trying to do?
Hello cool person,

I use sentry-sdk to catch any errors in my project and I also use niquests, lately I have been seeing one CDN domain keep timing out when I request it with niquest's AsyncSession via HTTP/2, currently it shows like this:
image

But if you can provide a nice __repr__ method to AsyncPoolManager (and maybe other public classes) which return some useful info for debugging purposes, then sentry-sdk can utilize and print that nice repr which helps debug the issue faster. 😄

Example where sentry shows nice repr if the object has it:
image

I will be submitting same feature request to niquests repo for niquests.AsyncHTTPAdapter.

How do you expect to do it?
Is it something you currently cannot do?
Is this related to an existing issue/problem?

Alternatives

Can you achieve the same result doing it in an alternative way?
Is the alternative considerable?
Not sure.

Duplicate

Has the feature been requested before?
If so, please provide a link to the issue.
Not from my search in repo's issues.

Contribution

Would you be willing to submit a PR?
(Help can be provided if you need assistance submitting a PR)
Sure.

@Ousret
Copy link
Member

Ousret commented Jan 12, 2025

This is an excellent idea.

The first step would be defining what we'd want displayed.

Right from the top of my head:

<AsyncPoolManager size?
    AsyncPoolConnection<'host:port'  size?
         AsyncHttpConnection<state, is_idle, is_saturated, ..?>
    >,
    ...
>

Define to us your day to day needs, so that we start by trying resolving an existing pain. Then we'll think of what could be added on top. Of course, we'll need the sync counter part to be included.

Feel free to start a draft PR, I will assist and provide guidance (if necessary).

Regards,

@owocado
Copy link
Author

owocado commented Jan 12, 2025

Alright, thank you for the prompt response. 👍🏼

I will submit draft PR once I am done with my pending todo work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants