Skip to content

pool.activeCount is always undefined #1402

Closed
@abenhamdine

Description

@abenhamdine

Hi Brianc,

It looks like pool.activeCount (https://node-postgres.com/api/pool#-code-pool-totalcount-int-code-) is always undefined :

my code :

pool.on('connect', (client) => {
	console.log(`Nb of clients in pool : total = ${pool.totalCount} idle = ${pool.idleCount} active = ${pool.activeCount}`);
});

console :

Nb of clients in pool : total = 2 idle = 0 active = undefined
Nb of clients in pool : total = 3 idle = 1 active = undefined
Nb of clients in pool : total = 3 idle = 1 active = undefined
Nb of clients in pool : total = 8 idle = 2 active = undefined
Nb of clients in pool : total = 8 idle = 2 active = undefined
Nb of clients in pool : total = 8 idle = 2 active = undefined
Nb of clients in pool : total = 8 idle = 3 active = undefined
Nb of clients in pool : total = 8 idle = 3 active = undefined

Since activeCount is simply (per docs) pool.totalCount - pool.idleCount perhaps activeCount is not necessary and it's just a documentation issue ?

versions:

node 8.2.1
[email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions