本文介绍了hikaricp获取繁忙的连接数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

像我们可以通过使用 dataSource.getNumBusyConnections()的方法获得c3p0中的繁忙连接数,同样的方式我们如何可以在hikaricp的情况下?任何人都可以提供c3p0和hikaricp之间的所有相关方法?还有什么是hikaricp中的destroy(在c3p0中)方法?

解决方案

p>





HikariDataSource 支持 close() shutdown()方法。它们是等价的。



更新: =https://gist.github.com/brettwooldridge/405d7c54784fc3a99813 =nofollow>使用JMX的简单gist 您可以尝试。


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?

解决方案

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.

这篇关于hikaricp获取繁忙的连接数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 00:52