brianc / node-pg-pool

A connection pool for node-postgres
MIT License
180 stars 64 forks source link

Emit 'release' event and add 'activeCount' gettable property to pool #124

Open PrimeJunta opened 5 years ago

PrimeJunta commented 5 years ago

Currently the pool only tracks total clients and pending connections. It would be extremely useful to be able to know how many clients are checked-out (active) at any given time, as this would make it easy to create unit tests specifically to test for bugs that leak clients.

ghost commented 4 years ago

You can just do pool.totalCount - pool.idleCount to get the active client count