Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.

Commit 25f7689

Browse files
authored
Merge pull request #4691 from withspectrum/fix-db-connection-count-tracking
Improve db connection count tracking
2 parents 8c2a197 + 68b9554 commit 25f7689

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shared/db/db.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ poolMaster.on('queueing', size => {
5959
statsd.gauge('db.query_queue.size', size);
6060
});
6161

62-
poolMaster.on('size', size => {
63-
statsd.gauge('db.connections.count', size);
64-
});
62+
setInterval(() => {
63+
statsd.gauge('db.connections.count', poolMaster.getLength());
64+
}, 5000);
6565

6666
// Exit the process on unhealthy db in test env
6767
if (process.env.TEST_DB) {

0 commit comments

Comments
 (0)