|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.ehcache.statistics.sampled.SampledCacheStatisticsWrapper
public class SampledCacheStatisticsWrapper
An implementation of SampledCacheStatistics
and also implements CacheUsageListener
and depends on the notification
received from
these to update the stats. Uses separate delegates depending on whether
sampled statistics is enabled or not.
CacheUsageListener
to a Cache
Field Summary |
---|
Fields inherited from interface net.sf.ehcache.statistics.sampled.CacheStatisticsSampler |
---|
DEFAULT_HISTORY_SIZE, DEFAULT_INTERVAL_SECS, DEFAULT_SEARCH_INTERVAL_SEC |
Constructor Summary | |
---|---|
SampledCacheStatisticsWrapper()
Default constructor. |
Method Summary | |
---|---|
void |
clearStatistics()
Clears sampled statistics for this cache |
void |
disableSampledStatistics()
Disable sampled statistics collection |
void |
dispose()
Called to dispose off the listener |
void |
enableSampledStatistics(FailSafeTimer timer)
Enabled sampled statistics with submitted FailSafeTimer and SampledCounter default configurations |
void |
enableSampledStatistics(FailSafeTimer timer,
SampledCounterConfig config,
SampledRateCounterConfig rateGetConfig,
SampledRateCounterConfig rateSearchConfig)
Enabled sampled statistics with submitted FailSafeTimer and SampledCounter the specified configurations |
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 statisticsAccuracy)
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SampledCacheStatisticsWrapper()
Method Detail |
---|
public void enableSampledStatistics(FailSafeTimer timer)
FailSafeTimer
and SampledCounter
default configurations
timer
- the FailSafeTimer
for samplingpublic void enableSampledStatistics(FailSafeTimer timer, SampledCounterConfig config, SampledRateCounterConfig rateGetConfig, SampledRateCounterConfig rateSearchConfig)
FailSafeTimer
and SampledCounter
the specified configurations
timer
- the FailSafeTimer
for samplingconfig
- the SampledCounterConfig
for samplingrateGetConfig
- the SampledRateCounterConfig
for sampling average time of cache getsrateSearchConfig
- the SampledCounterConfig
for sampling average time of cache searchespublic void disableSampledStatistics()
public boolean isSampledStatisticsEnabled()
isSampledStatisticsEnabled
in interface SampledCacheStatistics
public void dispose()
dispose
in interface CacheUsageListener
dispose
in interface SampledCacheStatistics
public long getAverageGetTimeMostRecentSample()
getAverageGetTimeMostRecentSample
in interface SampledCacheStatistics
public long getAverageGetTimeNanosMostRecentSample()
SampledCacheStatistics
getAverageGetTimeNanosMostRecentSample
in interface SampledCacheStatistics
public long getCacheElementEvictedMostRecentSample()
getCacheElementEvictedMostRecentSample
in interface SampledCacheStatistics
public long getCacheElementExpiredMostRecentSample()
getCacheElementExpiredMostRecentSample
in interface SampledCacheStatistics
public long getCacheElementPutMostRecentSample()
getCacheElementPutMostRecentSample
in interface SampledCacheStatistics
public long getCacheElementRemovedMostRecentSample()
getCacheElementRemovedMostRecentSample
in interface SampledCacheStatistics
public long getCacheElementUpdatedMostRecentSample()
getCacheElementUpdatedMostRecentSample
in interface SampledCacheStatistics
public long getCacheHitInMemoryMostRecentSample()
getCacheHitInMemoryMostRecentSample
in interface SampledCacheStatistics
public long getCacheHitOffHeapMostRecentSample()
getCacheHitOffHeapMostRecentSample
in interface SampledCacheStatistics
public long getCacheHitMostRecentSample()
getCacheHitMostRecentSample
in interface SampledCacheStatistics
public long getCacheHitOnDiskMostRecentSample()
getCacheHitOnDiskMostRecentSample
in interface SampledCacheStatistics
public long getCacheMissExpiredMostRecentSample()
getCacheMissExpiredMostRecentSample
in interface SampledCacheStatistics
public long getCacheMissMostRecentSample()
getCacheMissMostRecentSample
in interface SampledCacheStatistics
public long getCacheMissInMemoryMostRecentSample()
getCacheMissInMemoryMostRecentSample
in interface SampledCacheStatistics
public long getCacheMissOffHeapMostRecentSample()
getCacheMissOffHeapMostRecentSample
in interface SampledCacheStatistics
public long getCacheMissOnDiskMostRecentSample()
getCacheMissOnDiskMostRecentSample
in interface SampledCacheStatistics
public long getCacheMissNotFoundMostRecentSample()
getCacheMissNotFoundMostRecentSample
in interface SampledCacheStatistics
public int getStatisticsAccuracy()
getStatisticsAccuracy
in interface SampledCacheStatistics
public void clearStatistics()
clearStatistics
in interface SampledCacheStatistics
SampledCacheStatistics.clearStatistics()
public String getStatisticsAccuracyDescription()
getStatisticsAccuracyDescription
in interface SampledCacheStatistics
public void notifyCacheElementEvicted()
notifyCacheElementEvicted
in interface CacheUsageListener
public void notifyCacheElementExpired()
notifyCacheElementExpired
in interface CacheUsageListener
public void notifyCacheElementPut()
notifyCacheElementPut
in interface CacheUsageListener
public void notifyCacheElementRemoved()
notifyCacheElementRemoved
in interface CacheUsageListener
public void notifyCacheElementUpdated()
notifyCacheElementUpdated
in interface CacheUsageListener
public void notifyCacheHitInMemory()
notifyCacheHitInMemory
in interface CacheUsageListener
public void notifyCacheHitOffHeap()
notifyCacheHitOffHeap
in interface CacheUsageListener
public void notifyCacheHitOnDisk()
notifyCacheHitOnDisk
in interface CacheUsageListener
public void notifyCacheMissedWithExpired()
notifyCacheMissedWithExpired
in interface CacheUsageListener
public void notifyCacheMissedWithNotFound()
notifyCacheMissedWithNotFound
in interface CacheUsageListener
public void notifyCacheMissInMemory()
notifyCacheMissInMemory
in interface CacheUsageListener
public void notifyCacheMissOffHeap()
notifyCacheMissOffHeap
in interface CacheUsageListener
public void notifyCacheMissOnDisk()
notifyCacheMissOnDisk
in interface CacheUsageListener
public void notifyRemoveAll()
notifyRemoveAll
in interface CacheUsageListener
public void notifyStatisticsAccuracyChanged(int statisticsAccuracy)
notifyStatisticsAccuracyChanged
in interface CacheUsageListener
statisticsAccuracy
- one of Statistics#STATISTICS_ACCURACY_BEST_EFFORT,
Statistics#STATISTICS_ACCURACY_GUARANTEED,
Statistics#STATISTICS_ACCURACY_NONEpublic void notifyStatisticsCleared()
notifyStatisticsCleared
in interface CacheUsageListener
public void notifyStatisticsEnabledChanged(boolean enableStatistics)
notifyStatisticsEnabledChanged
in interface CacheUsageListener
public void notifyTimeTakenForGet(long millis)
notifyTimeTakenForGet
in interface CacheUsageListener
public void notifyGetTimeNanos(long nanos)
notifyGetTimeNanos
in interface CacheUsageListener
public long getAverageSearchTime()
getAverageSearchTime
in interface SampledCacheStatistics
public long getSearchesPerSecond()
getSearchesPerSecond
in interface SampledCacheStatistics
public void notifyCacheSearch(long executeTime)
notifyCacheSearch
in interface CacheUsageListener
executeTime
- elapsed time in millispublic void notifyXaCommit()
notifyXaCommit
in interface CacheUsageListener
public void notifyXaRollback()
notifyXaRollback
in interface CacheUsageListener
public long getCacheXaCommitsMostRecentSample()
getCacheXaCommitsMostRecentSample
in interface SampledCacheStatistics
public long getCacheXaRollbacksMostRecentSample()
getCacheXaRollbacksMostRecentSample
in interface SampledCacheStatistics
public SampledCounter getCacheHitSample()
CacheStatisticsSampler
SampledCounter
for cache hit
getCacheHitSample
in interface CacheStatisticsSampler
SampledCounter
for cache hit countpublic SampledCounter getCacheHitInMemorySample()
CacheStatisticsSampler
SampledCounter
for in-memory cache hit
getCacheHitInMemorySample
in interface CacheStatisticsSampler
SampledCounter
for cache hit count in memorypublic SampledCounter getCacheHitOffHeapSample()
CacheStatisticsSampler
SampledCounter
for off-heap cache hit
getCacheHitOffHeapSample
in interface CacheStatisticsSampler
SampledCounter
for cache hit count in off-heappublic SampledCounter getCacheHitOnDiskSample()
CacheStatisticsSampler
SampledCounter
for on-disk cache hit
getCacheHitOnDiskSample
in interface CacheStatisticsSampler
SampledCounter
for cache hit count on diskpublic SampledCounter getCacheMissSample()
CacheStatisticsSampler
SampledCounter
for cache miss
getCacheMissSample
in interface CacheStatisticsSampler
SampledCounter
for cache miss countpublic SampledCounter getCacheMissInMemorySample()
CacheStatisticsSampler
SampledCounter
for in-memory cache miss
getCacheMissInMemorySample
in interface CacheStatisticsSampler
SampledCounter
for cache miss count in memorypublic SampledCounter getCacheMissOffHeapSample()
CacheStatisticsSampler
SampledCounter
for off-heap cache miss
getCacheMissOffHeapSample
in interface CacheStatisticsSampler
SampledCounter
for cache miss count in off-heappublic SampledCounter getCacheMissOnDiskSample()
CacheStatisticsSampler
SampledCounter
for on-disk cache miss
getCacheMissOnDiskSample
in interface CacheStatisticsSampler
SampledCounter
for cache miss count on diskpublic SampledCounter getCacheMissExpiredSample()
CacheStatisticsSampler
SampledCounter
for cache miss as result of the element getting
expired
getCacheMissExpiredSample
in interface CacheStatisticsSampler
SampledCounter
for cache miss count and the reason for miss
being the element got expiredpublic SampledCounter getCacheMissNotFoundSample()
CacheStatisticsSampler
SampledCounter
for cache miss as result of the element not found
in cache
getCacheMissNotFoundSample
in interface CacheStatisticsSampler
SampledCounter
for cache miss not found countpublic SampledCounter getCacheElementEvictedSample()
CacheStatisticsSampler
SampledCounter
element evicted from cache
getCacheElementEvictedSample
in interface CacheStatisticsSampler
SampledCounter
for element evicted countpublic SampledCounter getCacheElementRemovedSample()
CacheStatisticsSampler
SampledCounter
element removed from cache
getCacheElementRemovedSample
in interface CacheStatisticsSampler
SampledCounter
for element removed countpublic SampledCounter getCacheElementExpiredSample()
CacheStatisticsSampler
SampledCounter
element expired from cache
getCacheElementExpiredSample
in interface CacheStatisticsSampler
public SampledCounter getCacheElementPutSample()
CacheStatisticsSampler
SampledCounter
element puts in the cache
getCacheElementPutSample
in interface CacheStatisticsSampler
SampledCounter
for number of element putspublic SampledCounter getCacheElementUpdatedSample()
CacheStatisticsSampler
SampledCounter
element updates , i.e. put() on elements with
already existing keys in the cache
getCacheElementUpdatedSample
in interface CacheStatisticsSampler
SampledCounter
d value for element update countpublic SampledRateCounter getAverageGetTimeSample()
CacheStatisticsSampler
SampledRateCounter
for average time taken for get() operation in the
cache
getAverageGetTimeSample
in interface CacheStatisticsSampler
SampledRateCounter
of average get time taken for a get operationpublic SampledRateCounter getAverageGetTimeNanosSample()
CacheStatisticsSampler
SampledRateCounter
for average time taken for get() operation in the
cache
getAverageGetTimeNanosSample
in interface CacheStatisticsSampler
SampledRateCounter
of average get time taken for a get operationpublic SampledRateCounter getAverageSearchTimeSample()
CacheStatisticsSampler
SampledRateCounter
for average search execution time for searches finishing within the last sample period
getAverageSearchTimeSample
in interface CacheStatisticsSampler
SampledRateCounter
of average search time takenpublic SampledCounter getSearchesPerSecondSample()
CacheStatisticsSampler
SampledCounter
for number of searches that have finished in the interval
getSearchesPerSecondSample
in interface CacheStatisticsSampler
SampledCounter
for number of searchespublic SampledCounter getCacheXaCommitsSample()
CacheStatisticsSampler
SampledCounter
for number of XA Transaction commits that have completed in the interval
getCacheXaCommitsSample
in interface CacheStatisticsSampler
SampledCounter
for number XA Transaction commitspublic SampledCounter getCacheXaRollbacksSample()
CacheStatisticsSampler
SampledCounter
for number of XA Transaction rollbacks that have completed in the interval
getCacheXaRollbacksSample
in interface CacheStatisticsSampler
SampledCounter
for number XA Transaction rollbackspublic int getCacheHitRatioMostRecentSample()
SampledCacheStatistics
getCacheHitRatioMostRecentSample
in interface SampledCacheStatistics
public SampledCounter getCacheHitRatioSample()
CacheStatisticsSampler
SampledCounter
for cache hit ratio
getCacheHitRatioSample
in interface CacheStatisticsSampler
SampledCounter
for cache hit ratio
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |