Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tool for monitoring Hibernate cache usage

Is there any tool which would allow for monitoring Hibernate 2nd level cache usage? I know that I could use Hibernate API for retrieving such information. But what should I do when I have application which doesn't read the information itself, and I can't modify it? Is there any way to read cache statistics from the outside of the application?

like image 551
oo_olo_oo Avatar asked Nov 17 '25 21:11

oo_olo_oo


1 Answers

Quoting Hibernate documentation:

3.4.6. Hibernate statistics

If you enable hibernate.generate_statistics, Hibernate exposes a number of metrics that are useful when tuning a running system via SessionFactory.getStatistics(). Hibernate can even be configured to expose these statistics via JMX. Read the Javadoc of the interfaces in org.hibernate.stats for more information.

You'll find the org.hibernate.stats package-summary here.

For the JMX part, have a look at Publishing statistics through JMX.

For more advanced stuff, you'll have to rely on specific features from your cache provider.

like image 118
Pascal Thivent Avatar answered Nov 20 '25 11:11

Pascal Thivent



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!