Top Description Methods
net.sf.ehcache.management.sampled

public Interface CacheSampler

extends LegacyCacheStatistics
Known Direct Subinterfaces
net.sf.ehcache.management.sampled.SampledCacheMBean
Known Direct Implementers
net.sf.ehcache.management.sampled.CacheSamplerImpl
Imports
java.util.Map, net.sf.ehcache.util.ManagementAttribute, net.sf.ehcache.util.counter.sampled.SampledCounter, .SampledRateCounter

An interface for exposing cache statistics. Extends from LegacyCacheStatistics
Authors
Abhishek Sanoujam, byoukste

Method Summary

Modifier and TypeMethod and Description
public void
flush()

Flushes all cache items from memory to the disk store, and from the DiskStore to disk.

public long

Returns:

average get time (nanos.)
getAverageGetTime
()

Gets the average get time.

public SampledRateCounter

Returns:

the SampledRateCounter of average get time taken for a get operation
getAverageGetTimeSample
()

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

public long

Returns:

search time
getAverageSearchTime
()

Gets the average search time.

public SampledRateCounter

Returns:

the SampledRateCounter of average search time taken
getAverageSearchTimeSample
()

Get the SampledRateCounter for average search execution time for searches finishing within the last sample period.

public SampledCounter

Returns:

the SampledCounter for offline cache cluster events
getCacheClusterOfflineSample
()

Get the SampledCounter for offline cache cluster events.

public SampledCounter

Returns:

the SampledCounter for online cache cluster events
getCacheClusterOnlineSample
()

Get the SampledCounter for online cache cluster events.

public SampledCounter

Returns:

the SampledCounter for rejoin cache cluster events
getCacheClusterRejoinSample
()

Get the SampledCounter for rejoin cache cluster events.

public SampledCounter

Returns:

the SampledCounter for element evicted count
getCacheElementEvictedSample
()

Get the SampledCounter element evicted from cache.

public SampledCounter

Returns:

Most recent value for element expired count
getCacheElementExpiredSample
()

Get the SampledCounter element expired from cache.

public SampledCounter

Returns:

the SampledCounter for number of element puts
getCacheElementPutSample
()

Get the SampledCounter element puts in the cache.

public SampledCounter

Returns:

the SampledCounter for element removed count
getCacheElementRemovedSample
()

Get the SampledCounter element removed from cache.

public SampledCounter

Returns:

the SampledCounterd value for element update count
getCacheElementUpdatedSample
()

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

public long

Returns:

eviction rate
getCacheEvictionRate
()

Gets the cache eviction rate.

public long

Returns:

expiration rate
getCacheExpirationRate
()

Gets the cache expiration rate.

public SampledCounter

Returns:

the SampledCounter for cache hit count in memory
getCacheHitInMemorySample
()

Get the SampledCounter for in-memory cache hit.

public SampledCounter

Returns:

the SampledCounter for cache hit count in off-heap
getCacheHitOffHeapSample
()

Get the SampledCounter for off-heap cache hit.

public SampledCounter

Returns:

the SampledCounter for cache hit count on disk
getCacheHitOnDiskSample
()

Get the SampledCounter for on-disk cache hit.

public long

Returns:

hit rate
getCacheHitRate
()

Gets the cache hit rate.

public SampledCounter

Returns:

the SampledCounter for cache hit ratio
getCacheHitRatioSample
()

Get the SampledCounter for cache hit ratio.

public SampledCounter

Returns:

the SampledCounter for cache hit count
getCacheHitSample
()

Get the SampledCounter for cache hit.

public long

Returns:

in-memory hit rate
getCacheInMemoryHitRate
()

Gets the cache in memory hit rate.

public long

Returns:

in-memory miss rate
getCacheInMemoryMissRate
()

Gets the cache in memory miss rate.

public SampledCounter

Returns:

the SampledCounter for cache miss count and the reason for miss being the element got expired
getCacheMissExpiredSample
()

Get the SampledCounter for cache miss as result of the element getting expired.

public SampledCounter

Returns:

the SampledCounter for cache miss count in memory
getCacheMissInMemorySample
()

Get the SampledCounter for in-memory cache miss.

public SampledCounter

Returns:

the SampledCounter for cache miss not found count
getCacheMissNotFoundSample
()

Get the SampledCounter for cache miss as result of the element not found in cache.

public SampledCounter

Returns:

the SampledCounter for cache miss count in off-heap
getCacheMissOffHeapSample
()

Get the SampledCounter for off-heap cache miss.

public SampledCounter

Returns:

the SampledCounter for cache miss count on disk
getCacheMissOnDiskSample
()

Get the SampledCounter for on-disk cache miss.

public long

Returns:

miss rate
getCacheMissRate
()

Gets the cache miss rate.

public SampledCounter

Returns:

the SampledCounter for cache miss count
getCacheMissSample
()

Get the SampledCounter for cache miss.

public long

Returns:

off-heap hit rate
getCacheOffHeapHitRate
()

Gets the cache off heap hit rate.

public long

Returns:

off-heap miss rate
getCacheOffHeapMissRate
()

Gets the cache off heap miss rate.

public long

Returns:

on-disk hit rate
getCacheOnDiskHitRate
()

Gets the cache on disk hit rate.

public long

Returns:

on-disk miss rate
getCacheOnDiskMissRate
()

Gets the cache on disk miss rate.

public long

Returns:

put rate
getCachePutRate
()

Gets the cache put rate.

public long

Returns:

remove rate
getCacheRemoveRate
()

Gets the cache remove rate.

public long

Returns:

search rate
getCacheSearchRate
()

Gets the cache search rate.

public long

Returns:

update rate
getCacheUpdateRate
()

Gets the cache update rate.

public SampledCounter

Returns:

the SampledCounter for number XA Transaction commits
getCacheXaCommitsSample
()

Get the SampledCounter for number of XA Transaction commits that have completed in the interval.

public SampledCounter

Returns:

the SampledCounter for number XA Transaction rollbacks
getCacheXaRollbacksSample
()

Get the SampledCounter for number of XA Transaction rollbacks that have completed in the interval.

public long

Returns:

Value for disk expiry thread interval in seconds specified in config
getDiskExpiryThreadIntervalSeconds
()

Configuration property accessor

public boolean

Returns:

the checks for write behind writer
getHasWriteBehindWriter
()

Is there a registered Write-behind CacheWriter.

public SampledCounter

Returns:

the SampledCounter for local disk size in bytes
getLocalDiskSizeInBytesSample
()

Get the SampledCounter for local disk size in bytes.

public SampledCounter

Returns:

the SampledCounter for local disk size
getLocalDiskSizeSample
()

Get the SampledCounter for local disk size.

public SampledCounter

Returns:

the SampledCounter for local heap size in bytes
getLocalHeapSizeInBytesSample
()

Get the SampledCounter for local heap size in bytes.

public SampledCounter

Returns:

the SampledCounter for local heap size
getLocalHeapSizeSample
()

Get the SampledCounter for local heap size.

public SampledCounter

Returns:

the SampledCounter for local offheap size in bytes
getLocalOffHeapSizeInBytesSample
()

Get the SampledCounter for local offheap size in bytes.

public SampledCounter

Returns:

the SampledCounter for local offheap size
getLocalOffHeapSizeSample
()

Get the SampledCounter for local offheap size.

public long

Returns:

Max bytes local disk config setting value
getMaxBytesLocalDisk
()

Configuration property accessor.

public String

Returns:

Max bytes local disk config setting value as string
getMaxBytesLocalDiskAsString
()

Configuration property accessor.

public long

Returns:

Max bytes local heap config setting value
getMaxBytesLocalHeap
()

Configuration property accessor.

public String

Returns:

Max bytes local heap config setting value as string
getMaxBytesLocalHeapAsString
()

Configuration property accessor.

public long

Returns:

Max bytes local offheap config setting value
getMaxBytesLocalOffHeap
()

Configuration property accessor.

public String

Returns:

Max bytes local offheap config setting value as string
getMaxBytesLocalOffHeapAsString
()

Configuration property accessor.

public int

Returns:

Max elements on disk config setting value
getMaxElementsOnDisk
()

Configuration property accessor.

public long

Returns:

Max entries in cache config setting value
getMaxEntriesInCache
()

Configuration property accessor.

public long

Returns:

Max entries local disk config setting value
getMaxEntriesLocalDisk
()

Configuration property accessor.

public long

Returns:

Max entries local heap config setting value
getMaxEntriesLocalHeap
()

Configuration property accessor.

public String

Returns:

a String representation of the policy
getMemoryStoreEvictionPolicy
()

Configuration property accessor.

public long

Returns:

the most recent rejoin time stamp millis
getMostRecentRejoinTimeStampMillis
()

Get the timestamp in nanos of the last rejoin.

public SampledCounter

Returns:

the SampledCounter for last rejoin timestamp
getMostRecentRejoinTimestampMillisSample
()

Get the SampledCounter for last rejoin timestamp.

public long

Returns:

the non stop failure most recent sample
getNonStopFailureRate
()

Gets the non stop failure most recent sample.

public SampledCounter

Returns:

the nonstop failure sample
getNonStopFailureSample
()

Gets the nonstop failure sample.

public long

Returns:

the non stop rejoin most recent sample
getNonStopRejoinTimeoutRate
()

Gets the non stop rejoin most recent sample.

public SampledCounter

Returns:

the nonstop rejoin sample
getNonStopRejoinTimeoutSample
()

Gets the nonstop rejoin sample.

public long

Returns:

the non stop success most recent sample
getNonStopSuccessRate
()

Gets the non stop success most recent sample.

public SampledCounter

Returns:

the nonstop success sample
getNonStopSuccessSample
()

Gets the nonstop success sample.

public long

Returns:

the non stop timeout most recent sample
getNonStopTimeoutRate
()

Gets the non stop timeout most recent sample.

public SampledCounter

Returns:

the nonstop timeout sample
getNonStopTimeoutSample
()

Gets the nonstop timeout sample.

public String

Returns:

the strategy name
getPersistenceStrategy
()

getPersistenceStrategy

public String

Returns:

the store to which this cache is pinned
getPinnedToStore
()

Configuration property accessor.

public SampledCounter

Returns:

putIfAbsent miss sample
getPutIfAbsentMissSample
()

Gets the putIfAbsent miss sample

public SampledCounter

Returns:

putIfAbsent success sample
getPutIfAbsentSuccessSample
()

Gets the putIfAbsent success sample

public SampledCounter

Returns:

the SampledCounter for remote size
getRemoteSizeSample
()

Get the SampledCounter for remote size.

public SampledCounter

Returns:

removeElement miss sample
getRemoveElementMissSample
()

Gets the removeElement miss sample

public SampledCounter

Returns:

removeElement success sample
getRemoveElementSuccessSample
()

Gets the removeElement success sample

public SampledCounter

Returns:

one arg miss sample
getReplaceOneArgMissSample
()

Gets the one arg replace miss sample

public SampledCounter

Returns:

one arg success sample
getReplaceOneArgSuccessSample
()

Gets the one arg replace success sample

public SampledCounter

Returns:

two arg miss sample
getReplaceTwoArgMissSample
()

Gets the two arg replace miss sample

public SampledCounter

Returns:

two arg success sample
getReplaceTwoArgSuccessSample
()

Gets the two arg replace success sample

public boolean

Returns:

the searchable
getSearchable
()

Is the cache configured for search.

public Map<String, String>

Returns:

map of search attribute name -> type name
getSearchAttributes
()

Get the declared search attributes and their type names.

public SampledCounter

Returns:

the SampledCounter for number of searches
getSearchesPerSecondSample
()

Get the SampledCounter for number of searches that have finished in the interval.

public SampledCounter

Returns:

the SampledCounter for cache size
getSizeSample
()

Get the SampledCounter for cache size.

public String

Returns:

The status value from the Status enum class
getStatus
()

Gets the status attribute of the Cache.

public String

Returns:

"STRONG", "EVENTUAL", or "na" if the cache is not Terracotta-clustered
getTerracottaConsistency
()

Returns a textual description of a Terracotta-clustered cache's consistency mode.

public long

Returns:

TTI in config
getTimeToIdleSeconds
()

Configuration property accessor.

public long

Returns:

TTL in config
getTimeToLiveSeconds
()

Configuration property accessor.

public boolean

Returns:

the transactional
getTransactional
()

Is the cache a transactional one.

public long

Returns:

Xa commit rate
getTransactionCommitRate
()

Gets the transaction commit rate.

public long

Returns:

Xa rollback rate
getTransactionRollbackRate
()

Gets the transaction rollback rate.

public int

Returns:

Number of configured processing queues/threads for use by the write-behind writer
getWriterConcurrency
()

Returns the number of configured write-behind queues/threads.

public int

Returns:

Maximum elements that can be queued for processing by the write-behind writer
getWriterMaxQueueSize
()

Returns the maximum size of any write-behind queues.

public long

Returns:

writer-behind queue length
getWriterQueueLength
()

Redeclares net.sf.ehcache.management.sampled.LegacyCacheStatistics.getWriterQueueLength.

Returns the total length of all write-behind queues for this cache.
public SampledCounter

Returns:

the SampledCounter for writer queue length
getWriterQueueLengthSample
()

Get the SampledCounter for writer queue length.

public boolean

Returns:

true, if is cluster bulk load enabled
isClusterBulkLoadEnabled
()

Is the cache in bulk-load mode cluster-wide?.

public boolean

Returns:

true if configured with disk persistence
isDiskPersistent
()

Configuration property accessor.

public boolean

Returns:

true, if is enabled
isEnabled
()

Is the cache enabled?.

public boolean

Returns:

true if set to eternal in config
isEternal
()

Configuration property accessor.

public boolean

Returns:

true if logging is enabled on the cache
isLoggingEnabled
()

Configuration property accessor.

public boolean

Returns:

true, if is node bulk load enabled
isNodeBulkLoadEnabled
()

Is the cache in bulk-load mode locally?.

public boolean

Returns:

true if overflow to disk specified in config
isOverflowToDisk
()

Configuration property accessor.

public boolean

Returns:

true if configured for offheap
isOverflowToOffHeap
()

isOverflowToOffHeap

public boolean

Returns:

true if the cache is pinned
isPinned
()

Configuration property accessor.

public boolean

Returns:

true if clustered with terracotta
isTerracottaClustered
()

Is the cache configured with Terracotta clustering?.

public void
removeAll()

Removes all cached items.

public void
setDiskExpiryThreadIntervalSeconds(long
the new disk expiry thread interval seconds
seconds
)

setDiskExpiryThreadIntervalSeconds.

public void
setDiskPersistent(boolean
the new disk persistent
diskPersistent
)

setDiskPersistent.

public void
setEnabled(boolean
the new enabled
enabled
)

Enabled/disable the cache.

public void
setEternal(boolean
the new eternal
eternal
)

setEternal.

public void
setLoggingEnabled(boolean
the new logging enabled
enabled
)

setLoggingEnabled.

public void
setMaxBytesLocalDisk(long
the new max bytes local disk
maxBytes
)

setMaxBytesLocalDisk.

public void
setMaxBytesLocalDiskAsString(String
the new max bytes local disk as string
maxBytes
)

setMaxBytesLocalDisk.

public void
setMaxBytesLocalHeap(long
the new max bytes local heap
maxBytes
)

setMaxBytesLocalHeap.

public void
setMaxBytesLocalHeapAsString(String
the new max bytes local heap as string
maxBytes
)

setMaxBytesLocalHeap.

public void
setMaxElementsOnDisk(int
the new max elements on disk
maxElements
)

setMaxElementsOnDisk.

public void
setMaxEntriesInCache(long
the new max entries in cache
maxEntries
)

setMaxEntriesInCache.

public void
setMaxEntriesLocalDisk(long
the new max entries local disk
maxEntries
)

setMaxEntriesLocalDisk.

public void
setMaxEntriesLocalHeap(long
the new max entries local heap
maxEntries
)

setMaxEntriesLocalHeap.

public void
setMemoryStoreEvictionPolicy(String
the new memory store eviction policy
evictionPolicy
)

setMemoryStoreEvictionPolicy.

public void
setNodeBulkLoadEnabled(boolean
the new node bulk load enabled
bulkLoadEnabled
)

Enabled/disable bulk-load mode for this node.

public void
setOverflowToDisk(boolean
the new overflow to disk
overflowToDisk
)

setOverflowToDisk.

public void
setTimeToIdleSeconds(long
the new time to idle seconds
tti
)

setTimeToIdleSeconds.

public void
setTimeToLiveSeconds(long
the new time to live seconds
ttl
)

setTimeToLiveSeconds.

Inherited from net.sf.ehcache.management.sampled.LegacyCacheStatistics:
disposegetAverageGetTimeNanosgetAverageGetTimeNanosMostRecentSamplegetAverageSearchTimeNanosgetCacheClusterOfflineCountgetCacheClusterOfflineMostRecentSamplegetCacheClusterOnlineCountgetCacheClusterOnlineMostRecentSamplegetCacheClusterRejoinCountgetCacheClusterRejoinMostRecentSamplegetCacheElementEvictedMostRecentSamplegetCacheElementExpiredMostRecentSamplegetCacheElementPutMostRecentSamplegetCacheElementRemovedMostRecentSamplegetCacheElementUpdatedMostRecentSamplegetCacheHitCountgetCacheHitInMemoryMostRecentSamplegetCacheHitMostRecentSamplegetCacheHitOffHeapMostRecentSamplegetCacheHitOnDiskMostRecentSamplegetCacheHitRatiogetCacheHitRatioMostRecentSamplegetCacheMissCountgetCacheMissCountExpiredgetCacheMissExpiredMostRecentSamplegetCacheMissInMemoryMostRecentSamplegetCacheMissMostRecentSamplegetCacheMissNotFoundMostRecentSamplegetCacheMissOffHeapMostRecentSamplegetCacheMissOnDiskMostRecentSamplegetCacheNamegetCacheXaCommitsMostRecentSamplegetCacheXaRollbacksMostRecentSamplegetEvictedCountgetExpiredCountgetInMemoryHitCountgetInMemoryMissCountgetInMemorySizegetLocalDiskSizegetLocalDiskSizeInBytesgetLocalHeapSizegetLocalHeapSizeInBytesgetLocalOffHeapSizegetLocalOffHeapSizeInBytesgetMaxGetTimeNanosgetMinGetTimeNanosgetNonStopFailureCountgetNonStopFailureMostRecentSamplegetNonStopRejoinTimeoutCountgetNonStopRejoinTimeoutMostRecentSamplegetNonStopSuccessCountgetNonStopSuccessMostRecentSamplegetNonStopTimeoutCountgetNonStopTimeoutMostRecentSamplegetNonstopTimeoutRatiogetOffHeapHitCountgetOffHeapMissCountgetOffHeapSizegetOnDiskHitCountgetOnDiskMissCountgetOnDiskSizegetPutCountgetPutIfAbsentMissCountgetPutIfAbsentMissRategetPutIfAbsentSuccessCountgetPutIfAbsentSuccessRategetRemovedCountgetRemoveElementMissCountgetRemoveElementMissRategetRemoveElementSuccessCountgetRemoveElementSuccessRategetReplaceOneArgMissCountgetReplaceOneArgMissRategetReplaceOneArgSuccessCountgetReplaceOneArgSuccessRategetReplaceTwoArgMissCountgetReplaceTwoArgMissRategetReplaceTwoArgSuccessCountgetReplaceTwoArgSuccessRategetSearchesPerSecondgetSizegetUpdateCountgetXaCommitCountgetXaRecoveredCountgetXaRollbackCountisLocalHeapCountBased