ehcache

net.sf.ehcache.management.sampled
Class CacheSamplerImpl

java.lang.Object
  extended by net.sf.ehcache.management.sampled.CacheSamplerImpl
All Implemented Interfaces:
CacheConfigurationListener, CacheSampler, LegacyCacheStatistics

public class CacheSamplerImpl
extends Object
implements CacheSampler, CacheConfigurationListener

An implementation of CacheSampler

Author:
Abhishek Sanoujam, byoukste There is stupid here -- *Sample() is the same as *Rate()

Constructor Summary
CacheSamplerImpl(Ehcache cache)
          Constructor accepting the backing Ehcache
 
Method Summary
 void deregistered(CacheConfiguration config)
          Indicates that this listener was removed from the given configuration
 void diskCapacityChanged(int oldCapacity, int newCapacity)
          Indicates a change in the configurations disk store capacity
 void dispose()
          Method used to dispose this statistics
 void flush()
          Flushes all cache items from memory to the disk store, and from the DiskStore to disk.
 long getAverageGetTime()
          
 long getAverageGetTimeNanos()
          Average time in nanoseconds taken to get an element from the cache.
 long getAverageGetTimeNanosMostRecentSample()
          Get most recent value for average time taken for get() operation in the cache
 SampledRateCounter getAverageGetTimeSample()
          Get the SampledRateCounter for average time taken for get() operation in the cache
 long getAverageSearchTime()
          
 long getAverageSearchTimeNanos()
          Get the average search execution time for searches finishing within the last sample period
 SampledRateCounter getAverageSearchTimeSample()
          Get the SampledRateCounter for average search execution time for searches finishing within the last sample period
 long getCacheElementEvictedMostRecentSample()
          Get most recent value element evicted from cache
 SampledCounter getCacheElementEvictedSample()
          Get the SampledCounter element evicted from cache
 long getCacheElementExpiredMostRecentSample()
          Get most recent value element expired from cache
 SampledCounter getCacheElementExpiredSample()
          Get the SampledCounter element expired from cache
 long getCacheElementPutMostRecentSample()
          Get most recent value element puts in the cache
 SampledCounter getCacheElementPutSample()
          Get the SampledCounter element puts in the cache
 long getCacheElementRemovedMostRecentSample()
          Get most recent value element removed from cache
 SampledCounter getCacheElementRemovedSample()
          Get the SampledCounter element removed from cache
 long getCacheElementUpdatedMostRecentSample()
          Get most recent value element updates , i.e.
 SampledCounter getCacheElementUpdatedSample()
          Get the SampledCounter element updates , i.e.
 long getCacheEvictionRate()
          
 long getCacheExpirationRate()
          
 long getCacheHitCount()
          The number of times a requested item was found in the cache.
 long getCacheHitInMemoryMostRecentSample()
          Get most recent value for in-memory cache hit
 SampledCounter getCacheHitInMemorySample()
          Get the SampledCounter for in-memory cache hit
 long getCacheHitMostRecentSample()
          Get most recent value for cache hit
 long getCacheHitOffHeapMostRecentSample()
          Get most recent value for off-heap cache hit
 SampledCounter getCacheHitOffHeapSample()
          Get the SampledCounter for off-heap cache hit
 long getCacheHitOnDiskMostRecentSample()
          Get most recent value for on-disk cache hit
 SampledCounter getCacheHitOnDiskSample()
          Get the SampledCounter for on-disk cache hit
 long getCacheHitRate()
          
 int getCacheHitRatio()
          The ratio of hits to accesses (hits + misses).
 int getCacheHitRatioMostRecentSample()
          Get most recent value for cache hit ratio
 SampledCounter getCacheHitRatioSample()
          Get the SampledCounter for cache hit ratio
 SampledCounter getCacheHitSample()
          Get the SampledCounter for cache hit
 long getCacheInMemoryHitRate()
          
 long getCacheInMemoryMissRate()
          
 long getCacheMissCount()
          Number of times a requested element was not found in the cache.
 long getCacheMissCountExpired()
          
 long getCacheMissExpiredMostRecentSample()
          Get most recent value for cache miss as result of the element getting expired
 SampledCounter getCacheMissExpiredSample()
          Get the SampledCounter for cache miss as result of the element getting expired
 long getCacheMissInMemoryMostRecentSample()
          Get most recent value for in-memory cache miss
 SampledCounter getCacheMissInMemorySample()
          Get the SampledCounter for in-memory cache miss
 long getCacheMissMostRecentSample()
          Get most recent value for cache miss
 long getCacheMissNotFoundMostRecentSample()
          Get most recent value for cache miss as result of the element not found in cache
 SampledCounter getCacheMissNotFoundSample()
          Get the SampledCounter for cache miss as result of the element not found in cache
 long getCacheMissOffHeapMostRecentSample()
          Get most recent value for off-heap cache miss
 SampledCounter getCacheMissOffHeapSample()
          Get the SampledCounter for off-heap cache miss
 long getCacheMissOnDiskMostRecentSample()
          Get most recent value for on-disk cache miss
 SampledCounter getCacheMissOnDiskSample()
          Get the SampledCounter for on-disk cache miss
 long getCacheMissRate()
          
 SampledCounter getCacheMissSample()
          Get the SampledCounter for cache miss
 String getCacheName()
          
 long getCacheOffHeapHitRate()
          
 long getCacheOffHeapMissRate()
          
 long getCacheOnDiskHitRate()
          
 long getCacheOnDiskMissRate()
          
 long getCachePutRate()
          
 long getCacheRemoveRate()
          
 long getCacheSearchRate()
          
 long getCacheUpdateRate()
          
 long getCacheXaCommitsMostRecentSample()
          Get most recent value of XA commits
 SampledCounter getCacheXaCommitsSample()
          Get the SampledCounter for number of XA Transaction commits that have completed in the interval
 long getCacheXaRollbacksMostRecentSample()
          Get most recent value of XA rollbacks
 SampledCounter getCacheXaRollbacksSample()
          Get the SampledCounter for number of XA Transaction rollbacks that have completed in the interval
 long getDiskExpiryThreadIntervalSeconds()
          Configuration property accessor
 long getEvictedCount()
          Number of elements evicted from the cache
 long getExpiredCount()
          Number of elements expired since creation or last clear
 boolean getHasWriteBehindWriter()
          Is there a registered Write-behind CacheWriter
 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 getLocalDiskSize()
          Number of entries in the DiskStore
 long getLocalDiskSizeInBytes()
          Number of of bytes used by entries in the DiskStore
 long getLocalHeapSize()
          Number of entries in the MemoryStore
 long getLocalHeapSizeInBytes()
          Number of of bytes used by entries in the MemoryStore
 long getLocalOffHeapSize()
          Number of entries in the off-heap store
 long getLocalOffHeapSizeInBytes()
          Number of of bytes used by entries in the off-heap store
 long getMaxBytesLocalDisk()
          Configuration property accessor
 String getMaxBytesLocalDiskAsString()
          Configuration property accessor
 long getMaxBytesLocalHeap()
          Configuration property accessor
 String getMaxBytesLocalHeapAsString()
          Configuration property accessor
 long getMaxBytesLocalOffHeap()
          Configuration property accessor
 String getMaxBytesLocalOffHeapAsString()
          Configuration property accessor
 int getMaxElementsOnDisk()
          Configuration property accessor
 int getMaxEntriesInCache()
          Configuration property accessor
 long getMaxEntriesLocalDisk()
          Configuration property accessor
 long getMaxEntriesLocalHeap()
          Configuration property accessor
 long getMaxGetTimeNanos()
          Return maximum time taken for a get operation in the cache in milliseconds
 String getMemoryStoreEvictionPolicy()
          Configuration property accessor
 long getMinGetTimeNanos()
          Return minimum time taken for a get operation in the cache in nanoseconds
 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()
          Deprecated. use getLocalOffHeapSize()
 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()
          Deprecated. use getLocalDiskSize()
 String getPinnedToStore()
          Configuration property accessor
 long getPutCount()
          Number of puts that has happened in the cache
 long getRemovedCount()
          Number of elements removed since creation or last clear
 boolean getSearchable()
          Is the cache configured for search
 long getSearchesPerSecond()
          Get the number of searches that have finished execution in the last second
 SampledCounter getSearchesPerSecondSample()
          Get the SampledCounter for number of searches that have finished in the interval
 long getSize()
          Size of the cache based on current accuracy settings.
 String getStatus()
          Gets the status attribute of the Cache.
 String getTerracottaConsistency()
          Returns a textual description of a Terracotta-clustered cache's consistency mode.
 long getTimeToIdleSeconds()
          Configuration property accessor
 long getTimeToLiveSeconds()
          Configuration property accessor
 boolean getTransactional()
          Is the cache a transactional one
 long getTransactionCommitRate()
          
 long getTransactionRollbackRate()
          
 long getUpdateCount()
          Number of updates that as happened in the cache
 int getWriterConcurrency()
          Returns the number of configured write-behind queues/threads.
 int getWriterMaxQueueSize()
          Returns the maximum size of any write-behind queues.
 long getWriterQueueLength()
          Returns the total length of all write-behind queues for this cache
 long getXaCommitCount()
          Return the Cache's XAResource commit calls count
 long getXaRecoveredCount()
          Return the Cache's XAResource recovered XIDs count
 long getXaRollbackCount()
          Return the Cache's XAResource rollback calls count
 boolean isClusterBulkLoadEnabled()
          Is the cache in bulk-load mode cluster-wide?
 boolean isDiskPersistent()
          Configuration property accessor
 boolean isEnabled()
          Is the cache enabled?
 boolean isEternal()
          Configuration property accessor
 boolean isLoggingEnabled()
          Configuration property accessor
 boolean isNodeBulkLoadEnabled()
          Is the cache in bulk-load mode locally?
 boolean isOverflowToDisk()
          Configuration property accessor
 boolean isPinned()
          Configuration property accessor
 boolean isTerracottaClustered()
          Is the cache configured with Terracotta clustering?
 void loggingChanged(boolean oldValue, boolean newValue)
          Indicates a change in the configuration for enable/disable logging
 void maxBytesLocalDiskChanged(long oldValue, long newValue)
          Indicates a change in the configuration for maxBytesLocalDisk setting
 void maxBytesLocalHeapChanged(long oldValue, long newValue)
          Indicates a change in the configuration for maxBytesLocalHeap setting
 void maxEntriesInCacheChanged(int oldCapacity, int newCapacity)
          Indicates a change in the configuration for maxEntriesInCache setting
 void memoryCapacityChanged(int oldCapacity, int newCapacity)
          Indicates a change in the configurations memory store capacity
 void registered(CacheConfiguration config)
          Indicates that this listener was registered with the given configuration
 void removeAll()
          Removes all cached items.
 void setDiskExpiryThreadIntervalSeconds(long seconds)
          setDiskExpiryThreadIntervalSeconds
 void setDiskPersistent(boolean diskPersistent)
          setDiskPersistent
 void setEnabled(boolean enabled)
          Enabled/disable the cache.
 void setEternal(boolean eternal)
          setEternal
 void setLoggingEnabled(boolean enabled)
          setLoggingEnabled
 void setMaxBytesLocalDisk(long maxBytes)
          setMaxBytesLocalDisk
 void setMaxBytesLocalDiskAsString(String maxBytes)
          setMaxBytesLocalDisk
 void setMaxBytesLocalHeap(long maxBytes)
          setMaxBytesLocalHeap
 void setMaxBytesLocalHeapAsString(String maxBytes)
          setMaxBytesLocalHeap
 void setMaxElementsOnDisk(int maxElements)
          setMaxElementsOnDisk
 void setMaxEntriesInCache(int maxEntries)
          setMaxEntriesInCache
 void setMaxEntriesLocalDisk(long maxEntries)
          setMaxEntriesLocalDisk
 void setMaxEntriesLocalHeap(long maxEntries)
          setMaxEntriesLocalHeap
 void setMemoryStoreEvictionPolicy(String evictionPolicy)
          setMemoryStoreEvictionPolicy
 void setNodeBulkLoadEnabled(boolean bulkLoadEnabled)
          Enabled/disable bulk-load mode for this node.
 void setOverflowToDisk(boolean overflowToDisk)
          setOverflowToDisk
 void setTimeToIdleSeconds(long tti)
          setTimeToIdleSeconds
 void setTimeToLiveSeconds(long ttl)
          setTimeToLiveSeconds
 void timeToIdleChanged(long oldTimeToIdle, long newTimeToIdle)
          Indicates a change in the configurations time to idle
 void timeToLiveChanged(long oldTimeToLive, long newTimeToLive)
          Indicates a change in the configurations time to live
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheSamplerImpl

public CacheSamplerImpl(Ehcache cache)
Constructor accepting the backing Ehcache

Parameters:
cache - the cache object to use in initializing this sampled representation
Method Detail

isEnabled

public boolean isEnabled()
Is the cache enabled?

Specified by:
isEnabled in interface CacheSampler

setEnabled

public void setEnabled(boolean enabled)
Enabled/disable the cache.

Specified by:
setEnabled in interface CacheSampler

isClusterBulkLoadEnabled

public boolean isClusterBulkLoadEnabled()
Is the cache in bulk-load mode cluster-wide?

Specified by:
isClusterBulkLoadEnabled in interface CacheSampler

isNodeBulkLoadEnabled

public boolean isNodeBulkLoadEnabled()
Is the cache in bulk-load mode locally?

Specified by:
isNodeBulkLoadEnabled in interface CacheSampler

setNodeBulkLoadEnabled

public void setNodeBulkLoadEnabled(boolean bulkLoadEnabled)
Enabled/disable bulk-load mode for this node.

Specified by:
setNodeBulkLoadEnabled in interface CacheSampler

flush

public void flush()
Flushes all cache items from memory to the disk store, and from the DiskStore to disk.

Specified by:
flush in interface CacheSampler

getCacheName

public String getCacheName()

Specified by:
getCacheName in interface LegacyCacheStatistics
Returns:
the name of the Ehcache

getStatus

public String getStatus()
Gets the status attribute of the Cache.

Specified by:
getStatus in interface CacheSampler
Returns:
The status value from the Status enum class

removeAll

public void removeAll()
Removes all cached items.

Specified by:
removeAll in interface CacheSampler

getAverageGetTimeNanosMostRecentSample

public long getAverageGetTimeNanosMostRecentSample()
Get most recent value for average time taken for get() operation in the cache

Specified by:
getAverageGetTimeNanosMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample of average get time taken for a get operation

getCacheEvictionRate

public long getCacheEvictionRate()

Specified by:
getCacheEvictionRate in interface CacheSampler
Returns:
eviction rate

getCacheElementEvictedMostRecentSample

public long getCacheElementEvictedMostRecentSample()
Get most recent value element evicted from cache

Specified by:
getCacheElementEvictedMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for element evicted count

getCacheExpirationRate

public long getCacheExpirationRate()

Specified by:
getCacheExpirationRate in interface CacheSampler
Returns:
expiration rate

getCacheElementExpiredMostRecentSample

public long getCacheElementExpiredMostRecentSample()
Get most recent value element expired from cache

Specified by:
getCacheElementExpiredMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent value for element expired count

getCachePutRate

public long getCachePutRate()

Specified by:
getCachePutRate in interface CacheSampler
Returns:
put rate

getCacheElementPutMostRecentSample

public long getCacheElementPutMostRecentSample()
Get most recent value element puts in the cache

Specified by:
getCacheElementPutMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for number of element puts

getCacheRemoveRate

public long getCacheRemoveRate()

Specified by:
getCacheRemoveRate in interface CacheSampler
Returns:
remove rate

getCacheElementRemovedMostRecentSample

public long getCacheElementRemovedMostRecentSample()
Get most recent value element removed from cache

Specified by:
getCacheElementRemovedMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for element removed count

getCacheUpdateRate

public long getCacheUpdateRate()

Specified by:
getCacheUpdateRate in interface CacheSampler
Returns:
update rate

getCacheElementUpdatedMostRecentSample

public long getCacheElementUpdatedMostRecentSample()
Get most recent value element updates , i.e. put() on elements with already existing keys in the cache

Specified by:
getCacheElementUpdatedMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sampled value for element update count

getCacheInMemoryHitRate

public long getCacheInMemoryHitRate()

Specified by:
getCacheInMemoryHitRate in interface CacheSampler
Returns:
in-memory hit rate

getCacheHitInMemoryMostRecentSample

public long getCacheHitInMemoryMostRecentSample()
Get most recent value for in-memory cache hit

Specified by:
getCacheHitInMemoryMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache hit count in memory

getCacheOffHeapHitRate

public long getCacheOffHeapHitRate()

Specified by:
getCacheOffHeapHitRate in interface CacheSampler
Returns:
off-heap hit rate

getCacheHitOffHeapMostRecentSample

public long getCacheHitOffHeapMostRecentSample()
Get most recent value for off-heap cache hit

Specified by:
getCacheHitOffHeapMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache hit count in off-heap

getCacheHitRate

public long getCacheHitRate()

Specified by:
getCacheHitRate in interface CacheSampler
Returns:
hit rate

getCacheHitMostRecentSample

public long getCacheHitMostRecentSample()
Get most recent value for cache hit

Specified by:
getCacheHitMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache hit count

getCacheOnDiskHitRate

public long getCacheOnDiskHitRate()

Specified by:
getCacheOnDiskHitRate in interface CacheSampler
Returns:
on-disk hit rate

getCacheHitOnDiskMostRecentSample

public long getCacheHitOnDiskMostRecentSample()
Get most recent value for on-disk cache hit

Specified by:
getCacheHitOnDiskMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache hit count on disk

getCacheMissExpiredMostRecentSample

public long getCacheMissExpiredMostRecentSample()
Get most recent value for cache miss as result of the element getting expired

Specified by:
getCacheMissExpiredMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache miss count and the reason for miss being the element got expired

getCacheMissRate

public long getCacheMissRate()

Specified by:
getCacheMissRate in interface CacheSampler
Returns:
miss rate

getCacheMissMostRecentSample

public long getCacheMissMostRecentSample()
Get most recent value for cache miss

Specified by:
getCacheMissMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache miss count

getCacheInMemoryMissRate

public long getCacheInMemoryMissRate()

Specified by:
getCacheInMemoryMissRate in interface CacheSampler
Returns:
in-memory miss rate

getCacheMissInMemoryMostRecentSample

public long getCacheMissInMemoryMostRecentSample()
Get most recent value for in-memory cache miss

Specified by:
getCacheMissInMemoryMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache miss count in memory

getCacheOffHeapMissRate

public long getCacheOffHeapMissRate()

Specified by:
getCacheOffHeapMissRate in interface CacheSampler
Returns:
off-heap miss rate

getCacheMissOffHeapMostRecentSample

public long getCacheMissOffHeapMostRecentSample()
Get most recent value for off-heap cache miss

Specified by:
getCacheMissOffHeapMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache miss count in off-heap

getCacheOnDiskMissRate

public long getCacheOnDiskMissRate()

Specified by:
getCacheOnDiskMissRate in interface CacheSampler
Returns:
on-disk miss rate

getCacheMissOnDiskMostRecentSample

public long getCacheMissOnDiskMostRecentSample()
Get most recent value for on-disk cache miss

Specified by:
getCacheMissOnDiskMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache miss count on disk

getCacheMissNotFoundMostRecentSample

public long getCacheMissNotFoundMostRecentSample()
Get most recent value for cache miss as result of the element not found in cache

Specified by:
getCacheMissNotFoundMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent sample for cache miss not found count

dispose

public void dispose()
Method used to dispose this statistics

Specified by:
dispose in interface LegacyCacheStatistics

isTerracottaClustered

public boolean isTerracottaClustered()
Is the cache configured with Terracotta clustering?

Specified by:
isTerracottaClustered in interface CacheSampler
Returns:
true if clustered with terracotta

getTerracottaConsistency

public String getTerracottaConsistency()
Returns a textual description of a Terracotta-clustered cache's consistency mode.

Specified by:
getTerracottaConsistency in interface CacheSampler
Returns:
"STRONG", "EVENTUAL", or "na" if the cache is not Terracotta-clustered

getAverageGetTime

public long getAverageGetTime()

Specified by:
getAverageGetTime in interface CacheSampler
Returns:
average get time (nanos.)

getMaxGetTimeNanos

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

Specified by:
getMaxGetTimeNanos in interface LegacyCacheStatistics
Returns:
maximum time taken for a get operation in the cache in milliseconds

getMinGetTimeNanos

public long getMinGetTimeNanos()
Return minimum time taken for a get operation in the cache in nanoseconds

Specified by:
getMinGetTimeNanos in interface LegacyCacheStatistics
Returns:
minimum time taken for a get operation in the cache in nanoseconds

getXaCommitCount

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

Specified by:
getXaCommitCount in interface LegacyCacheStatistics
Returns:
the Cache's XAResource commit calls count

getXaRollbackCount

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

Specified by:
getXaRollbackCount in interface LegacyCacheStatistics
Returns:
the Cache's XAResource rollback calls count

getXaRecoveredCount

public long getXaRecoveredCount()
Return the Cache's XAResource recovered XIDs count

Specified by:
getXaRecoveredCount in interface LegacyCacheStatistics
Returns:
the Cache's XAResource recovered XIDs count

getHasWriteBehindWriter

public boolean getHasWriteBehindWriter()
Is there a registered Write-behind CacheWriter

Specified by:
getHasWriteBehindWriter in interface CacheSampler

getWriterQueueLength

public long getWriterQueueLength()
Returns the total length of all write-behind queues for this cache

Specified by:
getWriterQueueLength in interface CacheSampler
Specified by:
getWriterQueueLength in interface LegacyCacheStatistics
Returns:
writer-behind queue length

getWriterMaxQueueSize

public int getWriterMaxQueueSize()
Returns the maximum size of any write-behind queues.

Specified by:
getWriterMaxQueueSize in interface CacheSampler
Returns:
Maximum elements that can be queued for processing by the write-behind writer
See Also:
CacheWriterConfiguration.getWriteBehindMaxQueueSize()

getWriterConcurrency

public int getWriterConcurrency()
Returns the number of configured write-behind queues/threads.

Specified by:
getWriterConcurrency in interface CacheSampler
Returns:
Number of configured processing queues/threads for use by the write-behind writer
See Also:
CacheWriterConfiguration.getWriteBehindConcurrency()

getCacheHitCount

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

Specified by:
getCacheHitCount in interface LegacyCacheStatistics
Returns:
the number of times a requested item was found in the cache

getCacheMissCount

public long getCacheMissCount()
Number of times a requested element was not found in the cache.

Specified by:
getCacheMissCount in interface LegacyCacheStatistics
Returns:
the number of times a requested element was not found in the cache

getInMemoryMissCount

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

Specified by:
getInMemoryMissCount in interface LegacyCacheStatistics
Returns:
the number of times a requested item was not found in memory

getOffHeapMissCount

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

Specified by:
getOffHeapMissCount in interface LegacyCacheStatistics
Returns:
the number of times a requested item was not found in off-heap

getOnDiskMissCount

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

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

getCacheMissCountExpired

public long getCacheMissCountExpired()

Specified by:
getCacheMissCountExpired in interface LegacyCacheStatistics
Returns:
the number of times a requested element was not found in the cache and the reason being the element already expired

getDiskExpiryThreadIntervalSeconds

public long getDiskExpiryThreadIntervalSeconds()
Configuration property accessor

Specified by:
getDiskExpiryThreadIntervalSeconds in interface CacheSampler
Returns:
Value for disk expiry thread interval in seconds specified in config

setDiskExpiryThreadIntervalSeconds

public void setDiskExpiryThreadIntervalSeconds(long seconds)
setDiskExpiryThreadIntervalSeconds

Specified by:
setDiskExpiryThreadIntervalSeconds in interface CacheSampler

getMaxEntriesLocalHeap

public long getMaxEntriesLocalHeap()
Configuration property accessor

Specified by:
getMaxEntriesLocalHeap in interface CacheSampler
Returns:
Max entries local heap config setting value

setMaxEntriesLocalHeap

public void setMaxEntriesLocalHeap(long maxEntries)
setMaxEntriesLocalHeap

Specified by:
setMaxEntriesLocalHeap in interface CacheSampler

getMaxBytesLocalHeap

public long getMaxBytesLocalHeap()
Configuration property accessor

Specified by:
getMaxBytesLocalHeap in interface CacheSampler
Returns:
Max bytes local heap config setting value

setMaxBytesLocalHeap

public void setMaxBytesLocalHeap(long maxBytes)
setMaxBytesLocalHeap

Specified by:
setMaxBytesLocalHeap in interface CacheSampler

setMaxBytesLocalHeapAsString

public void setMaxBytesLocalHeapAsString(String maxBytes)
setMaxBytesLocalHeap

Specified by:
setMaxBytesLocalHeapAsString in interface CacheSampler

getMaxBytesLocalHeapAsString

public String getMaxBytesLocalHeapAsString()
Configuration property accessor

Specified by:
getMaxBytesLocalHeapAsString in interface CacheSampler
Returns:
Max bytes local heap config setting value as string

getMaxEntriesLocalDisk

public long getMaxEntriesLocalDisk()
Configuration property accessor

Specified by:
getMaxEntriesLocalDisk in interface CacheSampler
Returns:
Max entries local disk config setting value

setMaxEntriesLocalDisk

public void setMaxEntriesLocalDisk(long maxEntries)
setMaxEntriesLocalDisk

Specified by:
setMaxEntriesLocalDisk in interface CacheSampler

setMaxBytesLocalDisk

public void setMaxBytesLocalDisk(long maxBytes)
setMaxBytesLocalDisk

Specified by:
setMaxBytesLocalDisk in interface CacheSampler

setMaxBytesLocalDiskAsString

public void setMaxBytesLocalDiskAsString(String maxBytes)
setMaxBytesLocalDisk

Specified by:
setMaxBytesLocalDiskAsString in interface CacheSampler

getMaxBytesLocalDiskAsString

public String getMaxBytesLocalDiskAsString()
Configuration property accessor

Specified by:
getMaxBytesLocalDiskAsString in interface CacheSampler
Returns:
Max bytes local disk config setting value as string

getMaxElementsOnDisk

public int getMaxElementsOnDisk()
Configuration property accessor

Specified by:
getMaxElementsOnDisk in interface CacheSampler
Returns:
Max elements on disk config setting value

getMaxEntriesInCache

public int getMaxEntriesInCache()
Configuration property accessor

Specified by:
getMaxEntriesInCache in interface CacheSampler
Returns:
Max entries in cache config setting value

setMaxElementsOnDisk

public void setMaxElementsOnDisk(int maxElements)
setMaxElementsOnDisk

Specified by:
setMaxElementsOnDisk in interface CacheSampler

setMaxEntriesInCache

public void setMaxEntriesInCache(int maxEntries)
setMaxEntriesInCache

Specified by:
setMaxEntriesInCache in interface CacheSampler

getMaxBytesLocalDisk

public long getMaxBytesLocalDisk()
Configuration property accessor

Specified by:
getMaxBytesLocalDisk in interface CacheSampler
Returns:
Max bytes local disk config setting value

getMaxBytesLocalOffHeap

public long getMaxBytesLocalOffHeap()
Configuration property accessor

Specified by:
getMaxBytesLocalOffHeap in interface CacheSampler
Returns:
Max bytes local offheap config setting value

getMaxBytesLocalOffHeapAsString

public String getMaxBytesLocalOffHeapAsString()
Configuration property accessor

Specified by:
getMaxBytesLocalOffHeapAsString in interface CacheSampler
Returns:
Max bytes local offheap config setting value as string

getMemoryStoreEvictionPolicy

public String getMemoryStoreEvictionPolicy()
Configuration property accessor

Specified by:
getMemoryStoreEvictionPolicy in interface CacheSampler
Returns:
a String representation of the policy

setMemoryStoreEvictionPolicy

public void setMemoryStoreEvictionPolicy(String evictionPolicy)
setMemoryStoreEvictionPolicy

Specified by:
setMemoryStoreEvictionPolicy in interface CacheSampler

getTimeToIdleSeconds

public long getTimeToIdleSeconds()
Configuration property accessor

Specified by:
getTimeToIdleSeconds in interface CacheSampler
Returns:
TTI in config

setTimeToIdleSeconds

public void setTimeToIdleSeconds(long tti)
setTimeToIdleSeconds

Specified by:
setTimeToIdleSeconds in interface CacheSampler

getTimeToLiveSeconds

public long getTimeToLiveSeconds()
Configuration property accessor

Specified by:
getTimeToLiveSeconds in interface CacheSampler
Returns:
TTL in config

setTimeToLiveSeconds

public void setTimeToLiveSeconds(long ttl)
setTimeToLiveSeconds

Specified by:
setTimeToLiveSeconds in interface CacheSampler

isDiskPersistent

public boolean isDiskPersistent()
Configuration property accessor

Specified by:
isDiskPersistent in interface CacheSampler
Returns:
true if configured with disk persistence

setDiskPersistent

public void setDiskPersistent(boolean diskPersistent)
setDiskPersistent

Specified by:
setDiskPersistent in interface CacheSampler

isEternal

public boolean isEternal()
Configuration property accessor

Specified by:
isEternal in interface CacheSampler
Returns:
true if set to eternal in config

setEternal

public void setEternal(boolean eternal)
setEternal

Specified by:
setEternal in interface CacheSampler

isOverflowToDisk

public boolean isOverflowToDisk()
Configuration property accessor

Specified by:
isOverflowToDisk in interface CacheSampler
Returns:
true if overflow to disk specified in config

setOverflowToDisk

public void setOverflowToDisk(boolean overflowToDisk)
setOverflowToDisk

Specified by:
setOverflowToDisk in interface CacheSampler

isLoggingEnabled

public boolean isLoggingEnabled()
Configuration property accessor

Specified by:
isLoggingEnabled in interface CacheSampler
Returns:
true if logging is enabled on the cache

setLoggingEnabled

public void setLoggingEnabled(boolean enabled)
setLoggingEnabled

Specified by:
setLoggingEnabled in interface CacheSampler

isPinned

public boolean isPinned()
Configuration property accessor

Specified by:
isPinned in interface CacheSampler
Returns:
true if the cache is pinned
See Also:
PinningConfiguration

getPinnedToStore

public String getPinnedToStore()
Configuration property accessor

Specified by:
getPinnedToStore in interface CacheSampler
Returns:
the store to which this cache is pinned
See Also:
PinningConfiguration

getEvictedCount

public long getEvictedCount()
Number of elements evicted from the cache

Specified by:
getEvictedCount in interface LegacyCacheStatistics
Returns:
Number of elements evicted from the cache

getExpiredCount

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

Specified by:
getExpiredCount in interface LegacyCacheStatistics
Returns:
Number of expired elements

getInMemoryHitCount

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

Specified by:
getInMemoryHitCount in interface LegacyCacheStatistics
Returns:
the number of times a requested item was found in memory

getOffHeapHitCount

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

Specified by:
getOffHeapHitCount in interface LegacyCacheStatistics
Returns:
the number of times a requested item was found in off-heap

getOffHeapSize

@Deprecated
public long getOffHeapSize()
Deprecated. use getLocalOffHeapSize()

Number of elements in the off-heap store

Specified by:
getOffHeapSize in interface LegacyCacheStatistics
Returns:
the number of elements in off-heap

getOnDiskHitCount

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

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

getOnDiskSize

@Deprecated
public long getOnDiskSize()
Deprecated. use getLocalDiskSize()

Number of elements in the DiskStore

Specified by:
getOnDiskSize in interface LegacyCacheStatistics
Returns:
number of elements on disk

getLocalDiskSize

public long getLocalDiskSize()
Number of entries in the DiskStore

Specified by:
getLocalDiskSize in interface LegacyCacheStatistics
Returns:
number of elements on disk

getLocalHeapSize

public long getLocalHeapSize()
Number of entries in the MemoryStore

Specified by:
getLocalHeapSize in interface LegacyCacheStatistics
Returns:
the number of elements in memory

getLocalOffHeapSize

public long getLocalOffHeapSize()
Number of entries in the off-heap store

Specified by:
getLocalOffHeapSize in interface LegacyCacheStatistics
Returns:
the number of elements in off-heap

getLocalDiskSizeInBytes

public long getLocalDiskSizeInBytes()
Number of of bytes used by entries in the DiskStore

Specified by:
getLocalDiskSizeInBytes in interface LegacyCacheStatistics
Returns:
number of bytes used by elements on disk

getLocalHeapSizeInBytes

public long getLocalHeapSizeInBytes()
Number of of bytes used by entries in the MemoryStore

Specified by:
getLocalHeapSizeInBytes in interface LegacyCacheStatistics
Returns:
the number of of bytes used by elements in memory

getLocalOffHeapSizeInBytes

public long getLocalOffHeapSizeInBytes()
Number of of bytes used by entries in the off-heap store

Specified by:
getLocalOffHeapSizeInBytes in interface LegacyCacheStatistics
Returns:
the number of of bytes used by elements in off-heap

getPutCount

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

Specified by:
getPutCount in interface LegacyCacheStatistics
Returns:
Number of puts

getRemovedCount

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

Specified by:
getRemovedCount in interface LegacyCacheStatistics
Returns:
Number of elements removed

getSize

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

Specified by:
getSize in interface LegacyCacheStatistics
Returns:
The size of the cache based on current accuracy setting

getInMemorySize

public long getInMemorySize()
Number of elements in the MemoryStore

Specified by:
getInMemorySize in interface LegacyCacheStatistics
Returns:
the number of elements in memory

getUpdateCount

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

Specified by:
getUpdateCount in interface LegacyCacheStatistics
Returns:
Number of updates

deregistered

public void deregistered(CacheConfiguration config)
Indicates that this listener was removed from the given configuration

Specified by:
deregistered in interface CacheConfigurationListener

maxBytesLocalHeapChanged

public void maxBytesLocalHeapChanged(long oldValue,
                                     long newValue)
Indicates a change in the configuration for maxBytesLocalHeap setting

Specified by:
maxBytesLocalHeapChanged in interface CacheConfigurationListener
Parameters:
oldValue - old value in bytes
newValue - new value in bytes

maxBytesLocalDiskChanged

public void maxBytesLocalDiskChanged(long oldValue,
                                     long newValue)
Indicates a change in the configuration for maxBytesLocalDisk setting

Specified by:
maxBytesLocalDiskChanged in interface CacheConfigurationListener
Parameters:
oldValue - old value in bytes
newValue - new value in bytes

diskCapacityChanged

public void diskCapacityChanged(int oldCapacity,
                                int newCapacity)
Indicates a change in the configurations disk store capacity

Specified by:
diskCapacityChanged in interface CacheConfigurationListener
Parameters:
oldCapacity - previous capacity
newCapacity - new capacity

maxEntriesInCacheChanged

public void maxEntriesInCacheChanged(int oldCapacity,
                                     int newCapacity)
Indicates a change in the configuration for maxEntriesInCache setting

Specified by:
maxEntriesInCacheChanged in interface CacheConfigurationListener
Parameters:
oldCapacity - old value
newCapacity - new value

loggingChanged

public void loggingChanged(boolean oldValue,
                           boolean newValue)
Indicates a change in the configuration for enable/disable logging

Specified by:
loggingChanged in interface CacheConfigurationListener
Parameters:
oldValue - old value whether logging was enabled or not
newValue - new value whether logging was enabled or not

memoryCapacityChanged

public void memoryCapacityChanged(int oldCapacity,
                                  int newCapacity)
Indicates a change in the configurations memory store capacity

Specified by:
memoryCapacityChanged in interface CacheConfigurationListener
Parameters:
oldCapacity - previous capacity
newCapacity - new capacity

registered

public void registered(CacheConfiguration config)
Indicates that this listener was registered with the given configuration

Specified by:
registered in interface CacheConfigurationListener

timeToIdleChanged

public void timeToIdleChanged(long oldTimeToIdle,
                              long newTimeToIdle)
Indicates a change in the configurations time to idle

Specified by:
timeToIdleChanged in interface CacheConfigurationListener
Parameters:
oldTimeToIdle - previous time to idle value
newTimeToIdle - new time to idle value

timeToLiveChanged

public void timeToLiveChanged(long oldTimeToLive,
                              long newTimeToLive)
Indicates a change in the configurations time to live

Specified by:
timeToLiveChanged in interface CacheConfigurationListener
Parameters:
oldTimeToLive - previous time to live value
newTimeToLive - new time to live value

getAverageSearchTime

public long getAverageSearchTime()

Specified by:
getAverageSearchTime in interface CacheSampler
Returns:
search time

getSearchesPerSecond

public long getSearchesPerSecond()
Get the number of searches that have finished execution in the last second

Specified by:
getSearchesPerSecond in interface LegacyCacheStatistics

getTransactional

public boolean getTransactional()
Is the cache a transactional one

Specified by:
getTransactional in interface CacheSampler
See Also:
CacheConfiguration.TransactionalMode

getSearchable

public boolean getSearchable()
Is the cache configured for search

Specified by:
getSearchable in interface CacheSampler
See Also:
Searchable

getCacheSearchRate

public long getCacheSearchRate()

Specified by:
getCacheSearchRate in interface CacheSampler
Returns:
search rate

getTransactionCommitRate

public long getTransactionCommitRate()

Specified by:
getTransactionCommitRate in interface CacheSampler
Returns:
Xa commit rate

getCacheXaCommitsMostRecentSample

public long getCacheXaCommitsMostRecentSample()
Get most recent value of XA commits

Specified by:
getCacheXaCommitsMostRecentSample in interface LegacyCacheStatistics

getTransactionRollbackRate

public long getTransactionRollbackRate()

Specified by:
getTransactionRollbackRate in interface CacheSampler
Returns:
Xa rollback rate

getCacheXaRollbacksMostRecentSample

public long getCacheXaRollbacksMostRecentSample()
Get most recent value of XA rollbacks

Specified by:
getCacheXaRollbacksMostRecentSample in interface LegacyCacheStatistics

getCacheHitRatio

public int getCacheHitRatio()
The ratio of hits to accesses (hits + misses).

Specified by:
getCacheHitRatio in interface LegacyCacheStatistics
Returns:
the ratio of hits to (hits + misses) (0 - 100)

getCacheHitRatioMostRecentSample

public int getCacheHitRatioMostRecentSample()
Get most recent value for cache hit ratio

Specified by:
getCacheHitRatioMostRecentSample in interface LegacyCacheStatistics
Returns:
Most recent value for cache hit ratio

getCacheHitRatioSample

public SampledCounter getCacheHitRatioSample()
Get the SampledCounter for cache hit ratio

Specified by:
getCacheHitRatioSample in interface CacheSampler
Returns:
the SampledCounter for cache hit ratio

getAverageGetTimeNanos

public long getAverageGetTimeNanos()
Description copied from interface: LegacyCacheStatistics
Average time in nanoseconds taken to get an element from the cache.

Specified by:
getAverageGetTimeNanos in interface LegacyCacheStatistics
Returns:
Average time taken for a get operation in nanoseconds

getCacheHitSample

public SampledCounter getCacheHitSample()
Get the SampledCounter for cache hit

Specified by:
getCacheHitSample in interface CacheSampler
Returns:
the SampledCounter for cache hit count

getCacheHitInMemorySample

public SampledCounter getCacheHitInMemorySample()
Get the SampledCounter for in-memory cache hit

Specified by:
getCacheHitInMemorySample in interface CacheSampler
Returns:
the SampledCounter for cache hit count in memory

getCacheHitOffHeapSample

public SampledCounter getCacheHitOffHeapSample()
Get the SampledCounter for off-heap cache hit

Specified by:
getCacheHitOffHeapSample in interface CacheSampler
Returns:
the SampledCounter for cache hit count in off-heap

getCacheHitOnDiskSample

public SampledCounter getCacheHitOnDiskSample()
Get the SampledCounter for on-disk cache hit

Specified by:
getCacheHitOnDiskSample in interface CacheSampler
Returns:
the SampledCounter for cache hit count on disk

getCacheMissSample

public SampledCounter getCacheMissSample()
Get the SampledCounter for cache miss

Specified by:
getCacheMissSample in interface CacheSampler
Returns:
the SampledCounter for cache miss count

getCacheMissInMemorySample

public SampledCounter getCacheMissInMemorySample()
Get the SampledCounter for in-memory cache miss

Specified by:
getCacheMissInMemorySample in interface CacheSampler
Returns:
the SampledCounter for cache miss count in memory

getCacheMissOffHeapSample

public SampledCounter getCacheMissOffHeapSample()
Get the SampledCounter for off-heap cache miss

Specified by:
getCacheMissOffHeapSample in interface CacheSampler
Returns:
the SampledCounter for cache miss count in off-heap

getCacheMissOnDiskSample

public SampledCounter getCacheMissOnDiskSample()
Get the SampledCounter for on-disk cache miss

Specified by:
getCacheMissOnDiskSample in interface CacheSampler
Returns:
the SampledCounter for cache miss count on disk

getCacheMissExpiredSample

public SampledCounter getCacheMissExpiredSample()
Get the SampledCounter for cache miss as result of the element getting expired

Specified by:
getCacheMissExpiredSample in interface CacheSampler
Returns:
the SampledCounter for cache miss count and the reason for miss being the element got expired

getCacheMissNotFoundSample

public SampledCounter getCacheMissNotFoundSample()
Get the SampledCounter for cache miss as result of the element not found in cache

Specified by:
getCacheMissNotFoundSample in interface CacheSampler
Returns:
the SampledCounter for cache miss not found count

getCacheElementEvictedSample

public SampledCounter getCacheElementEvictedSample()
Get the SampledCounter element evicted from cache

Specified by:
getCacheElementEvictedSample in interface CacheSampler
Returns:
the SampledCounter for element evicted count

getCacheElementRemovedSample

public SampledCounter getCacheElementRemovedSample()
Get the SampledCounter element removed from cache

Specified by:
getCacheElementRemovedSample in interface CacheSampler
Returns:
the SampledCounter for element removed count

getCacheElementExpiredSample

public SampledCounter getCacheElementExpiredSample()
Get the SampledCounter element expired from cache

Specified by:
getCacheElementExpiredSample in interface CacheSampler
Returns:
Most recent value for element expired count

getCacheElementPutSample

public SampledCounter getCacheElementPutSample()
Get the SampledCounter element puts in the cache

Specified by:
getCacheElementPutSample in interface CacheSampler
Returns:
the SampledCounter for number of element puts

getCacheElementUpdatedSample

public SampledCounter getCacheElementUpdatedSample()
Get the SampledCounter element updates , i.e. put() on elements with already existing keys in the cache

Specified by:
getCacheElementUpdatedSample in interface CacheSampler
Returns:
the SampledCounterd value for element update count

getAverageGetTimeSample

public SampledRateCounter getAverageGetTimeSample()
Get the SampledRateCounter for average time taken for get() operation in the cache

Specified by:
getAverageGetTimeSample in interface CacheSampler
Returns:
the SampledRateCounter of average get time taken for a get operation

getAverageSearchTimeSample

public SampledRateCounter getAverageSearchTimeSample()
Get the SampledRateCounter for average search execution time for searches finishing within the last sample period

Specified by:
getAverageSearchTimeSample in interface CacheSampler
Returns:
the SampledRateCounter of average search time taken

getSearchesPerSecondSample

public SampledCounter getSearchesPerSecondSample()
Get the SampledCounter for number of searches that have finished in the interval

Specified by:
getSearchesPerSecondSample in interface CacheSampler
Returns:
the SampledCounter for number of searches

getCacheXaCommitsSample

public SampledCounter getCacheXaCommitsSample()
Get the SampledCounter for number of XA Transaction commits that have completed in the interval

Specified by:
getCacheXaCommitsSample in interface CacheSampler
Returns:
the SampledCounter for number XA Transaction commits

getCacheXaRollbacksSample

public SampledCounter getCacheXaRollbacksSample()
Get the SampledCounter for number of XA Transaction rollbacks that have completed in the interval

Specified by:
getCacheXaRollbacksSample in interface CacheSampler
Returns:
the SampledCounter for number XA Transaction rollbacks

getAverageSearchTimeNanos

public long getAverageSearchTimeNanos()
Description copied from interface: LegacyCacheStatistics
Get the average search execution time for searches finishing within the last sample period

Specified by:
getAverageSearchTimeNanos in interface LegacyCacheStatistics

ehcache

Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.