问题
Like we can get the number of busy connection in c3p0 by using method like dataSource.getNumBusyConnections()
, the same way how can we do that in case of hikaricp? Can anyone provide all the related methods between c3p0 and hikaricp? Also what is the destroy (in c3p0) method equivalent in hikaricp?
回答1:
Re: connections, see these wiki pages:
JMX Monitoring (via console and programatically
Using Codahale/Dropwizard Metrics
HikariDataSource
supports both close()
and shutdown()
methods, they are equivalent.
UPDATE: I put out a simple gist that uses JMX you can try.
来源:https://stackoverflow.com/questions/27268286/hikaricp-get-number-of-busy-connection