enhance metrics
Though the current metrics are useful we'd really like to see how many connections are in the pool and how many are available/in use.
We'd use this to:
1/ actual pool size - see if there were some allocation problem - e.g. the pool collapses due to some network or other problem
2/ pool available connections - see trends in available connections for tuning - reducing if we've over provisioned and increasing if we're near the limit - I guess the average time to get a connection from the pool might imply we've started to hit a pool size issue but it's not quite the same as being able to see the trend before we hit increases in getting a connections
Size wouldn't be hard. This value is already available internally, though it also includes allocations that failed and have yet to be reported externally.
Currently available is harder. You'd have to iterate the live queue and inspect the slot state, and count how many can be considered available. It's also very racy, since it's a bulk operation over objects that are changing concurrently, but I think that's a fair trade-off for keeping the overhead out of the claim fast-path.
If you're up for it, you could try doing a PR.