postgrelize / PoolCounters
Interface: PoolCounters ​
Defined in: src/connection/connection-types.ts:31
Live connection counts of a pool (Sequelize v6 sequelize-pool Pool). Every property is read at access time, so a health gauge can keep one reference. Reading never opens a connection: all counters are 0 before the first query.
Example ​
const { size, available, using, waiting, maxSize } = sequelize.connectionManager.pool;
console.log(`${using}/${maxSize} in use, ${waiting} waiting, ${available} idle of ${size}`);Extended by ​
Properties ​
available ​
readonlyavailable:number
Defined in: src/connection/connection-types.ts:35
Idle connections ready to be handed out (idleCount).
maxSize ​
readonlymaxSize:number
Defined in: src/connection/connection-types.ts:41
Configured pool.max (the pg default of 10 when unset).
size ​
readonlysize:number
Defined in: src/connection/connection-types.ts:33
Open connections, idle and checked out (totalCount of the pg pool).
using ​
readonlyusing:number
Defined in: src/connection/connection-types.ts:37
Checked out connections: size - available.
waiting ​
readonlywaiting:number
Defined in: src/connection/connection-types.ts:39
Acquisitions waiting for a free connection (waitingCount).