12.2. JBoss Cache Statistics

12.2. JBoss Cache Statistics

JBoss Cache captures statistics in its interceptors and exposes the statistics through interceptor MBeans. Cache interceptor MBeans are enabled by default; these MBeans can be disabled for a specific cache instance through the UseInterceptorMbeans attribute. See the Configuration chapter for further details on configuration of this attribute.

Each interceptor's MBean provides an attribute that can be used to disable maintenance of statistics for that interceptor. Note that the majority of the statistics are provided by the CacheMgmtInterceptor MBean so this interceptor is the most significant in this regard. If you want to disable all statistics for performance reasons, you should utilize the UseInterceptorMbeans configuration setting as this will prevent the CacheMgmtInterceptor from being included in the cache's interceptor stack when the cache is started.

Each interceptor provides the following common operations and attributes.

The following table describes the statistics currently available for JBoss Cache.

MBean Name Attribute Type Description
ActivationInterceptor Activations long Number of passivated nodes that have been activated.
CacheLoaderInterceptor CacheLoaderLoads long Number of nodes loaded through a cache loader.
CacheLoaderInterceptor CacheLoaderMisses long Number of unsuccessful attempts to load a node through a cache loader.
CacheMgmtInterceptor Hits long Number of successful attribute retrievals.
CacheMgmtInterceptor Misses long Number of unsuccessful attribute retrievals.
CacheMgmtInterceptor Stores long Number of attribute store operations.
CacheMgmtInterceptor Evictions long Number of node evictions.
CacheMgmtInterceptor NumberOfAttributes int Number of attributes currently cached.
CacheMgmtInterceptor NumberOfNodes int Number of nodes currently cached.
CacheMgmtInterceptor ElapsedTime long Number of seconds that the cache has been running.
CacheMgmtInterceptor TimeSinceReset long Number of seconds since the cache statistics have been reset.
CacheMgmtInterceptor AverageReadTime long Average time in milliseconds to retrieve a cache attribute, including unsuccessful attribute retrievals.
CacheMgmtInterceptor AverageWriteTime long Average time in milliseconds to write a cache attribute.
CacheMgmtInterceptor HitMissRatio double Ratio of hits to hits and misses. A hit is a get attribute operation that results in an object being returned to the client. The retrieval may be from a cache loader if the entry isn't in the local cache.
CacheMgmtInterceptor ReadWriteRatio double Ratio of read operations to write operations. This is the ratio of cache hits and misses to cache stores.
CacheStoreInterceptor CacheLoaderStores long Number of nodes written to the cache loader.
InvalidationInterceptor Invalidations long Number of cached nodes that have been invalidated.
PassivationInterceptor Passivations long Number of cached nodes that have been passivated.
TxInterceptor Prepares long Number of transaction prepare operations performed by this interceptor.
TxInterceptor Commits long Number of transaction commit operations performed by this interceptor.
TxInterceptor Rollbacks long Number of transaction rollbacks operations performed by this interceptor.

Table 12.1. JBoss Cache Management Statistics