ehcache

net.sf.ehcache.statistics
Interface LiveCacheStatistics

All Known Subinterfaces:
SampledCacheMBean
All Known Implementing Classes:
LiveCacheStatisticsImpl, LiveCacheStatisticsWrapper, NullLiveCacheStatisticsData, SampledCache

public interface LiveCacheStatistics

Interface for usage statistics of a Cache.

Implementations of this interface is different from Statistics in the way that values returned from this interface implementations will reflect the current state of the cache and not a snapshot of the cache when the api's were called (which is the behavior of Statistics)

Since:
1.7
Author:
Abhishek Sanoujam

Method Summary
 void clearStatistics()
          Clears statistics of this cache
 float getAverageGetTimeMillis()
          Average time in milli seconds taken to get an element from the cache.
 long getCacheHitCount()
          The number of times a requested item was found in the cache.
 long getCacheMissCount()
           
 long getCacheMissCountExpired()
           
 String getCacheName()
           
 long getEvictedCount()
          Number of elements evicted from the cache
 long getExpiredCount()
          Number of elements expired since creation or last clear
 long getInMemoryHitCount()
          Number of times a requested item was found in the Memory Store.
 long getInMemoryMissCount()
          Number of times a requested item was not found in the Memory Store.
 long getInMemorySize()
          Number of elements in the MemoryStore
 long getMaxGetTimeMillis()
          Return maximum time taken for a get operation in the cache in milliseconds
 long getMinGetTimeMillis()
          Return minimum time taken for a get operation in the cache in milliseconds
 long getOffHeapHitCount()
          Number of times a requested item was found in the off-heap store.
 long getOffHeapMissCount()
          Number of times a requested item was not found in the off-heap store.
 long getOffHeapSize()
          Number of elements in the off-heap store
 long getOnDiskHitCount()
          Number of times a requested item was found in the Disk Store.
 long getOnDiskMissCount()
          Number of times a requested item was not found in the Disk Store.
 long getOnDiskSize()
          Number of elements in the DiskStore
 long getPutCount()
          Number of puts that has happened in the cache
 long getRemovedCount()
          Number of elements removed since creation or last clear
 long getSize()
          Size of the cache based on current accuracy settings.
 int getStatisticsAccuracy()
          Accurately measuring statistics can be expensive.
 String getStatisticsAccuracyDescription()
          Accurately measuring statistics can be expensive.
 long getUpdateCount()
          Number of updates that as happened in the cache
 long getWriterQueueLength()
          Gets the size of the write-behind queue, if any.
 long getXaCommitCount()
          Return the Cache's XAResource commit calls count
 long getXaRollbackCount()
          Return the Cache's XAResource rollback calls count
 boolean isStatisticsEnabled()
          Returns true if statistics is enabled
 

Method Detail

isStatisticsEnabled

boolean isStatisticsEnabled()
Returns true if statistics is enabled

Returns:
true if statistics is enabled

getCacheHitCount

long getCacheHitCount()
The number of times a requested item was found in the cache.

Returns:
the number of times a requested item was found in the cache

getInMemoryHitCount

long getInMemoryHitCount()
Number of times a requested item was found in the Memory Store.

Returns:
the number of times a requested item was found in memory

getOffHeapHitCount

long getOffHeapHitCount()
Number of times a requested item was found in the off-heap store.

Returns:
the number of times a requested item was found in off-heap

getOnDiskHitCount

long getOnDiskHitCount()
Number of times a requested item was found in the Disk Store.

Returns:
the number of times a requested item was found on Disk, or 0 if there is no disk storage configured.

getCacheMissCount

long getCacheMissCount()
Returns:
the number of times a requested element was not found in the cache

getInMemoryMissCount

long getInMemoryMissCount()
Number of times a requested item was not found in the Memory Store.

Returns:
the number of times a requested item was not found in memory

getOffHeapMissCount

long getOffHeapMissCount()
Number of times a requested item was not found in the off-heap store.

Returns:
the number of times a requested item was not found in off-heap

getOnDiskMissCount

long getOnDiskMissCount()
Number of times a requested item was not found in the Disk Store.

Returns:
the number of times a requested item was not found on Disk, or 0 if there is no disk storage configured.

getCacheMissCountExpired

long getCacheMissCountExpired()
Returns:
the number of times a requested element was not found in the cache and the reason being the element already expired

getSize

long getSize()
Size of the cache based on current accuracy settings.

Returns:
The size of the cache based on currect accuracy setting

getInMemorySize

long getInMemorySize()
Number of elements in the MemoryStore

Returns:
the number of elements in memory

getOffHeapSize

long getOffHeapSize()
Number of elements in the off-heap store

Returns:
the number of elements in off-heap

getOnDiskSize

long getOnDiskSize()
Number of elements in the DiskStore

Returns:
number of elements on disk

getAverageGetTimeMillis

float getAverageGetTimeMillis()
Average time in milli seconds taken to get an element from the cache.

Returns:
Average time taken for a get operation in milliseconds

getEvictedCount

long getEvictedCount()
Number of elements evicted from the cache

Returns:
Number of elements evicted from the cache

getPutCount

long getPutCount()
Number of puts that has happened in the cache

Returns:
Number of puts

getUpdateCount

long getUpdateCount()
Number of updates that as happened in the cache

Returns:
Number of updates

getExpiredCount

long getExpiredCount()
Number of elements expired since creation or last clear

Returns:
Number of expired elements

getRemovedCount

long getRemovedCount()
Number of elements removed since creation or last clear

Returns:
Number of elements removed

getStatisticsAccuracy

int getStatisticsAccuracy()
Accurately measuring statistics can be expensive. Returns the current accuracy setting.

Returns:
one of Statistics.STATISTICS_ACCURACY_BEST_EFFORT, Statistics.STATISTICS_ACCURACY_GUARANTEED, Statistics.STATISTICS_ACCURACY_NONE

getStatisticsAccuracyDescription

String getStatisticsAccuracyDescription()
Accurately measuring statistics can be expensive. Returns the current accuracy setting.

Returns:
a human readable description of the accuracy setting. One of "None", "Best Effort" or "Guaranteed".

getCacheName

String getCacheName()
Returns:
the name of the Ehcache

clearStatistics

void clearStatistics()
Clears statistics of this cache


getMinGetTimeMillis

long getMinGetTimeMillis()
Return minimum time taken for a get operation in the cache in milliseconds

Returns:
minimum time taken for a get operation in the cache in milliseconds

getMaxGetTimeMillis

long getMaxGetTimeMillis()
Return maximum time taken for a get operation in the cache in milliseconds

Returns:
maximum time taken for a get operation in the cache in milliseconds

getWriterQueueLength

long getWriterQueueLength()
Gets the size of the write-behind queue, if any. The value is for all local buckets

Returns:
Elements waiting to be processed by the write-behind writer. -1 if no write-behind

getXaCommitCount

long getXaCommitCount()
Return the Cache's XAResource commit calls count

Returns:
the Cache's XAResource commit calls count

getXaRollbackCount

long getXaRollbackCount()
Return the Cache's XAResource rollback calls count

Returns:
the Cache's XAResource rollback calls count

ehcache

true