Skip to content

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 ​

ts
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 ​

readonly available: number

Defined in: src/connection/connection-types.ts:35

Idle connections ready to be handed out (idleCount).


maxSize ​

readonly maxSize: number

Defined in: src/connection/connection-types.ts:41

Configured pool.max (the pg default of 10 when unset).


size ​

readonly size: number

Defined in: src/connection/connection-types.ts:33

Open connections, idle and checked out (totalCount of the pg pool).


using ​

readonly using: number

Defined in: src/connection/connection-types.ts:37

Checked out connections: size - available.


waiting ​

readonly waiting: number

Defined in: src/connection/connection-types.ts:39

Acquisitions waiting for a free connection (waitingCount).

Released under the MIT License.