3

I trying to get the cache statistics programmatically in infinispan without JMX.

I used Ehcache in the past, it has a nice way to get the statistics programmatically like cache.getHitCount().

Any ideas on how to do the same in infinispan?

Note: I'm using Infinispan 6.0.2 version which comes by default with Wildfly 8.2.0.Final.

Sri
  • 4,613
  • 2
  • 39
  • 42

1 Answers1

7

You can access the stats via a AdvancedCache.getStats().

For example, from a Cache instance:

cache.getAdvancedCache().getStats().getHits()
pruivo
  • 1,214
  • 7
  • 7