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

Feature Request: Be able to introspect pool state/telemetry #37

Closed
aselder opened this issue Nov 3, 2023 · 4 comments
Closed

Feature Request: Be able to introspect pool state/telemetry #37

aselder opened this issue Nov 3, 2023 · 4 comments

Comments

@aselder
Copy link

aselder commented Nov 3, 2023

It would be nice to be able to get some telemetry from NimblePool.

In particular, it would be nice to be able to track pool utilization (# checkout/ #available) and time spent waiting for a resource.

@josevalim
Copy link
Member

josevalim commented Nov 3, 2023

Hi @aselder!

The information on checkout/available can be done on top of NimblePool. Especially because we keep resources as a queue, so we would need to keep a counter ourselves, so I would rather leave this decision to users. Wait time can also be computed on client by measuring the time before calling checkout and effectively checking out.

The only measurement that would need to be provided is the idle timeout, which we could improve NimblePool to send it downstream. Perhaps by allowing a three arity function on checkout, the third element being metadata (this one could also be emulated but it is quite more annoying to do so and it is information we already track).

@oliveigah
Copy link
Contributor

I'm currently working to implement something like this on Finch sneako/finch#183.

I think the only feature we will need to implement on the nimble pool side is a new callback for pool termination.

Because we need to clear all the metrics state when the pool is terminated.

If this makes sense to you I can implement it here. What you think @josevalim?

@josevalim
Copy link
Member

I will gladly accept terminate_pool callback :)

@josevalim
Copy link
Member

Closing this for now. If there is an interest on idle_timeout, please open up an issue, but now that I think about it, even it could be calculated. :)

@josevalim josevalim closed this as not planned Won't fix, can't repro, duplicate, stale Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants