2
votes

I am using hibernate 5.2.12.Final and hazelcast 3.12 for a application. I am running a hazelcast cluster. Also have hazelcast-mancenter-3.12 running to monitor the cluster and it all works great.

However I could not find anyway to see the statistics for the hibernate query cache hits from hazelcast mancenter or any other way.

So whats the best way to find out what are the query cache hits from hibernate when using hazelcast

1

1 Answers

1
votes

Hazelcast Management Center doesn't gather Hibernate stats. It only collects stats from Hazelcast cluster members. For query cache, Hazelcast Hibernate integration doesn't distribute data among Hazelcast cluster members, but keeps the data in its local cache and uses Hazelcast topics to distribute events between members. So, Hazelcast cluster members don't have any data, only the Hibernate integration has in its local cache.

In your case, you can get Hibernate query cache statistics via SessionFactory.getStatistics().getSecondLevelCacheStatistics() programmatically, or via any other standard means that Hibernate provides.