public class SampledCacheStatisticsImpl extends Object implements CacheUsageListener, CacheStatisticsSampler
SampledCacheStatistics This also implements CacheUsageListener and depends on
the notification
received from
these to update the stats
DEFAULT_HISTORY_SIZE, DEFAULT_INTERVAL_SECS, DEFAULT_SEARCH_INTERVAL_SEC| Constructor and Description |
|---|
SampledCacheStatisticsImpl(FailSafeTimer timer)
The default constructor
|
SampledCacheStatisticsImpl(FailSafeTimer timer,
SampledCounterConfig config) |
SampledCacheStatisticsImpl(FailSafeTimer timer,
SampledCounterConfig config,
SampledRateCounterConfig rateGetConfig,
SampledRateCounterConfig rateSearchConfig)
Constructor that accepts a timer which will be used to schedule the
sampled counters
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearStatistics()
Clears the collected statistics.
|
Object |
clone() |
void |
dispose()
Called to dispose off the listener
|
long |
getAverageGetTimeMostRecentSample()
Get most recent value for average time taken for get() operation in the
cache
|
long |
getAverageGetTimeNanosMostRecentSample()
Get most recent value for average time taken for get() operation in the
cache
|
SampledRateCounter |
getAverageGetTimeNanosSample()
Get the
SampledRateCounter 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()
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 |
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 |
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 |
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 |
SampledCounter |
getCacheMissSample()
Get the
SampledCounter for cache miss |
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 |
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 |
int |
getStatisticsAccuracy()
Get value for statisticsAccuracy
|
String |
getStatisticsAccuracyDescription()
Get Description for statisticsAccuracy
|
boolean |
isSampledStatisticsEnabled()
Returns true if statistics collection is enabled for cache, otherwise
false
|
void |
notifyCacheElementEvicted()
Called when an element is expired in the cache
|
void |
notifyCacheElementExpired()
Called when an element in the cache expires
|
void |
notifyCacheElementPut()
Called when an element is inserted in the cache
|
void |
notifyCacheElementRemoved()
Called when an element is removed from the cache
|
void |
notifyCacheElementUpdated()
Called when an element is updated in the cache, i.e.
|
void |
notifyCacheHitInMemory()
Called on a cache hit in the MemoryStore
|
void |
notifyCacheHitOffHeap()
Called on a cache hit in the off-heap store
|
void |
notifyCacheHitOnDisk()
Called on a cache hit in the DiskStore
|
void |
notifyCacheMissedWithExpired()
Called when an element is found in the cache but already expired
|
void |
notifyCacheMissedWithNotFound()
Called when an element is not found in the cache
|
void |
notifyCacheMissInMemory()
Called on a cache miss in the MemoryStore
|
void |
notifyCacheMissOffHeap()
Called on a cache miss in the off-heap store
|
void |
notifyCacheMissOnDisk()
Called on a cache miss in the DiskStore
|
void |
notifyCacheSearch(long executeTime)
Called when a search finishes execution
|
void |
notifyGetTimeNanos(long nanos)
Notified with time taken for a get operation in the cache
|
void |
notifyRemoveAll()
Called when Cache.removeAll() is called
|
void |
notifyStatisticsAccuracyChanged(int statisticsAccuracyValue)
Notified when the statistics accuracy is changed.
|
void |
notifyStatisticsCleared()
Called when statistics is cleared
|
void |
notifyStatisticsEnabledChanged(boolean enableStatistics)
Called when statistics is enabled/disabled
|
void |
notifyTimeTakenForGet(long millis)
Notified with time taken for a get operation in the cache
DEPRECATED: use notifyGetTimeNanos(long)
|
void |
notifyXaCommit()
Called when the Cache's XAResource has been asked to commit
|
void |
notifyXaRollback()
Called when the Cache's XAResource has been asked to rollback
|
public SampledCacheStatisticsImpl(FailSafeTimer timer)
timer - public SampledCacheStatisticsImpl(FailSafeTimer timer, SampledCounterConfig config)
timer - config - public SampledCacheStatisticsImpl(FailSafeTimer timer, SampledCounterConfig config, SampledRateCounterConfig rateGetConfig, SampledRateCounterConfig rateSearchConfig)
public void clearStatistics()
clearStatistics in interface SampledCacheStatisticspublic void notifyCacheElementEvicted()
notifyCacheElementEvicted in interface CacheUsageListenerpublic void notifyCacheHitInMemory()
notifyCacheHitInMemory in interface CacheUsageListenerpublic void notifyCacheHitOffHeap()
notifyCacheHitOffHeap in interface CacheUsageListenerpublic void notifyCacheHitOnDisk()
notifyCacheHitOnDisk in interface CacheUsageListenerpublic void notifyCacheMissedWithExpired()
notifyCacheMissedWithExpired in interface CacheUsageListenerpublic void notifyCacheMissedWithNotFound()
notifyCacheMissedWithNotFound in interface CacheUsageListenerpublic void notifyCacheMissInMemory()
notifyCacheMissInMemory in interface CacheUsageListenerpublic void notifyCacheMissOffHeap()
notifyCacheMissOffHeap in interface CacheUsageListenerpublic void notifyCacheMissOnDisk()
notifyCacheMissOnDisk in interface CacheUsageListenerpublic void dispose()
dispose in interface CacheUsageListenerdispose in interface SampledCacheStatisticspublic void notifyCacheElementExpired()
notifyCacheElementExpired in interface CacheUsageListenerpublic void notifyCacheElementPut()
throws CacheException
notifyCacheElementPut in interface CacheUsageListenerCacheExceptionpublic void notifyCacheElementRemoved()
throws CacheException
notifyCacheElementRemoved in interface CacheUsageListenerCacheExceptionpublic void notifyCacheElementUpdated()
throws CacheException
notifyCacheElementUpdated in interface CacheUsageListenerCacheExceptionpublic void notifyTimeTakenForGet(long millis)
notifyTimeTakenForGet in interface CacheUsageListenerpublic void notifyGetTimeNanos(long nanos)
CacheUsageListenernotifyGetTimeNanos in interface CacheUsageListenerpublic void notifyRemoveAll()
notifyRemoveAll in interface CacheUsageListenerpublic Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic void notifyStatisticsEnabledChanged(boolean enableStatistics)
notifyStatisticsEnabledChanged in interface CacheUsageListenerpublic void notifyStatisticsAccuracyChanged(int statisticsAccuracyValue)
notifyStatisticsAccuracyChanged in interface CacheUsageListenerstatisticsAccuracyValue - one of Statistics#STATISTICS_ACCURACY_BEST_EFFORT,
Statistics#STATISTICS_ACCURACY_GUARANTEED,
Statistics#STATISTICS_ACCURACY_NONEpublic void notifyStatisticsCleared()
notifyStatisticsCleared in interface CacheUsageListenerpublic long getCacheHitMostRecentSample()
getCacheHitMostRecentSample in interface SampledCacheStatisticspublic long getAverageGetTimeMostRecentSample()
getAverageGetTimeMostRecentSample in interface SampledCacheStatisticspublic long getAverageGetTimeNanosMostRecentSample()
getAverageGetTimeNanosMostRecentSample in interface SampledCacheStatisticspublic long getCacheElementEvictedMostRecentSample()
getCacheElementEvictedMostRecentSample in interface SampledCacheStatisticspublic long getCacheHitInMemoryMostRecentSample()
getCacheHitInMemoryMostRecentSample in interface SampledCacheStatisticspublic long getCacheHitOffHeapMostRecentSample()
getCacheHitOffHeapMostRecentSample in interface SampledCacheStatisticspublic long getCacheHitOnDiskMostRecentSample()
getCacheHitOnDiskMostRecentSample in interface SampledCacheStatisticspublic long getCacheMissExpiredMostRecentSample()
getCacheMissExpiredMostRecentSample in interface SampledCacheStatisticspublic long getCacheMissMostRecentSample()
getCacheMissMostRecentSample in interface SampledCacheStatisticspublic long getCacheMissInMemoryMostRecentSample()
getCacheMissInMemoryMostRecentSample in interface SampledCacheStatisticspublic long getCacheMissOffHeapMostRecentSample()
getCacheMissOffHeapMostRecentSample in interface SampledCacheStatisticspublic long getCacheMissOnDiskMostRecentSample()
getCacheMissOnDiskMostRecentSample in interface SampledCacheStatisticspublic long getCacheMissNotFoundMostRecentSample()
getCacheMissNotFoundMostRecentSample in interface SampledCacheStatisticspublic int getCacheHitRatioMostRecentSample()
getCacheHitRatioMostRecentSample in interface SampledCacheStatisticspublic long getCacheElementExpiredMostRecentSample()
getCacheElementExpiredMostRecentSample in interface SampledCacheStatisticspublic long getCacheElementPutMostRecentSample()
getCacheElementPutMostRecentSample in interface SampledCacheStatisticspublic long getCacheElementRemovedMostRecentSample()
getCacheElementRemovedMostRecentSample in interface SampledCacheStatisticspublic long getCacheElementUpdatedMostRecentSample()
getCacheElementUpdatedMostRecentSample in interface SampledCacheStatisticspublic int getStatisticsAccuracy()
getStatisticsAccuracy in interface SampledCacheStatisticspublic SampledCounter getCacheHitSample()
SampledCounter for cache hitgetCacheHitSample in interface CacheStatisticsSamplerSampledCounter for cache hit countpublic SampledCounter getCacheHitInMemorySample()
SampledCounter for in-memory cache hitgetCacheHitInMemorySample in interface CacheStatisticsSamplerSampledCounter for cache hit count in memorypublic SampledCounter getCacheHitOffHeapSample()
SampledCounter for off-heap cache hitgetCacheHitOffHeapSample in interface CacheStatisticsSamplerSampledCounter for cache hit count in off-heappublic SampledCounter getCacheHitOnDiskSample()
SampledCounter for on-disk cache hitgetCacheHitOnDiskSample in interface CacheStatisticsSamplerSampledCounter for cache hit count on diskpublic SampledCounter getCacheMissSample()
SampledCounter for cache missgetCacheMissSample in interface CacheStatisticsSamplerSampledCounter for cache miss countpublic SampledCounter getCacheMissInMemorySample()
SampledCounter for in-memory cache missgetCacheMissInMemorySample in interface CacheStatisticsSamplerSampledCounter for cache miss count in memorypublic SampledCounter getCacheMissOffHeapSample()
SampledCounter for off-heap cache missgetCacheMissOffHeapSample in interface CacheStatisticsSamplerSampledCounter for cache miss count in off-heappublic SampledCounter getCacheMissOnDiskSample()
SampledCounter for on-disk cache missgetCacheMissOnDiskSample in interface CacheStatisticsSamplerSampledCounter for cache miss count on diskpublic SampledCounter getCacheMissExpiredSample()
SampledCounter for cache miss as result of the element getting
expiredgetCacheMissExpiredSample in interface CacheStatisticsSamplerSampledCounter for cache miss count and the reason for miss
being the element got expiredpublic SampledCounter getCacheMissNotFoundSample()
SampledCounter for cache miss as result of the element not found
in cachegetCacheMissNotFoundSample in interface CacheStatisticsSamplerSampledCounter for cache miss not found countpublic SampledCounter getCacheHitRatioSample()
SampledCounter for cache hit ratiogetCacheHitRatioSample in interface CacheStatisticsSamplerSampledCounter for cache hit ratiopublic SampledCounter getCacheElementEvictedSample()
SampledCounter element evicted from cachegetCacheElementEvictedSample in interface CacheStatisticsSamplerSampledCounter for element evicted countpublic SampledCounter getCacheElementRemovedSample()
SampledCounter element removed from cachegetCacheElementRemovedSample in interface CacheStatisticsSamplerSampledCounter for element removed countpublic SampledCounter getCacheElementExpiredSample()
SampledCounter element expired from cachegetCacheElementExpiredSample in interface CacheStatisticsSamplerpublic SampledCounter getCacheElementPutSample()
SampledCounter element puts in the cachegetCacheElementPutSample in interface CacheStatisticsSamplerSampledCounter for number of element putspublic SampledCounter getCacheElementUpdatedSample()
SampledCounter element updates , i.e. put() on elements with
already existing keys in the cachegetCacheElementUpdatedSample in interface CacheStatisticsSamplerSampledCounterd value for element update countpublic SampledRateCounter getAverageGetTimeSample()
SampledRateCounter for average time taken for get() operation in the
cachegetAverageGetTimeSample in interface CacheStatisticsSamplerSampledRateCounter of average get time taken for a get operationpublic SampledRateCounter getAverageGetTimeNanosSample()
CacheStatisticsSamplerSampledRateCounter for average time taken for get() operation in the
cachegetAverageGetTimeNanosSample in interface CacheStatisticsSamplerSampledRateCounter of average get time taken for a get operationpublic SampledRateCounter getAverageSearchTimeSample()
SampledRateCounter for average search execution time for searches finishing within the last sample periodgetAverageSearchTimeSample in interface CacheStatisticsSamplerSampledRateCounter of average search time takenpublic SampledCounter getSearchesPerSecondSample()
SampledCounter for number of searches that have finished in the intervalgetSearchesPerSecondSample in interface CacheStatisticsSamplerSampledCounter for number of searchespublic String getStatisticsAccuracyDescription()
getStatisticsAccuracyDescription in interface SampledCacheStatisticspublic boolean isSampledStatisticsEnabled()
isSampledStatisticsEnabled in interface SampledCacheStatisticspublic long getAverageSearchTime()
getAverageSearchTime in interface SampledCacheStatisticspublic long getSearchesPerSecond()
getSearchesPerSecond in interface SampledCacheStatisticspublic SampledCounter getCacheXaCommitsSample()
SampledCounter for number of XA Transaction commits that have completed in the intervalgetCacheXaCommitsSample in interface CacheStatisticsSamplerSampledCounter for number XA Transaction commitspublic SampledCounter getCacheXaRollbacksSample()
SampledCounter for number of XA Transaction rollbacks that have completed in the intervalgetCacheXaRollbacksSample in interface CacheStatisticsSamplerSampledCounter for number XA Transaction rollbackspublic void notifyCacheSearch(long executeTime)
notifyCacheSearch in interface CacheUsageListenerexecuteTime - elapsed time in millispublic long getCacheXaCommitsMostRecentSample()
getCacheXaCommitsMostRecentSample in interface SampledCacheStatisticspublic void notifyXaCommit()
notifyXaCommit in interface CacheUsageListenerpublic long getCacheXaRollbacksMostRecentSample()
getCacheXaRollbacksMostRecentSample in interface SampledCacheStatisticspublic void notifyXaRollback()
notifyXaRollback in interface CacheUsageListenerCopyright © 2003-2014 Terracotta, Inc.. All Rights Reserved.