File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -99,11 +99,17 @@ export class RDSClient extends Operator {
9999 }
100100
101101 get stats ( ) {
102+ const acquiringConnections = this . #pool. _acquiringConnections . length ;
103+ const allConnections = this . #pool. _allConnections . length ;
104+ const freeConnections = this . #pool. _freeConnections . length ;
105+ const connectionQueue = this . #pool. _connectionQueue . length ;
106+ const busyConnections = allConnections - freeConnections - acquiringConnections ;
102107 return {
103- acquiringConnections : this . #pool. _acquiringConnections . length ,
104- allConnections : this . #pool. _allConnections . length ,
105- freeConnections : this . #pool. _freeConnections . length ,
106- connectionQueue : this . #pool. _connectionQueue . length ,
108+ acquiringConnections,
109+ allConnections,
110+ freeConnections,
111+ connectionQueue,
112+ busyConnections,
107113 } ;
108114 }
109115
Original file line number Diff line number Diff line change @@ -1340,11 +1340,11 @@ describe('test/client.test.ts', () => {
13401340 describe ( 'get stats()' , ( ) => {
13411341 it ( 'should get client stats' , async ( ) => {
13421342 const stats = db . stats ;
1343- console . log ( stats ) ;
13441343 assert . equal ( typeof stats . acquiringConnections , 'number' ) ;
13451344 assert . equal ( typeof stats . allConnections , 'number' ) ;
13461345 assert . equal ( typeof stats . freeConnections , 'number' ) ;
13471346 assert . equal ( typeof stats . connectionQueue , 'number' ) ;
1347+ assert . equal ( typeof stats . busyConnections , 'number' ) ;
13481348 } ) ;
13491349 } ) ;
13501350
You can’t perform that action at this time.
0 commit comments