Interface CacheStatistics
     Cache statistics are accumulated starting from the time a cache is created. 
     An instance of this class represents local node values only! For an accumulated view
     on cluster level, the user has to retrieve all nodes statistics and aggregate values
     on his own.
 
Sample code:
       ICache<Key, Value> unwrappedCache =  cache.unwrap( ICache.class );
       CacheStatistics cacheStatistics = unwrappedCache.getLocalCacheStatistics();
       long cacheHits = cacheStatistics.getCacheHits();
     - Since:
- 3.3.1
- 
Method SummaryModifier and TypeMethodDescriptionfloatThe mean time to execute gets.floatThe mean time to execute puts.floatThe mean time to execute removes.longThe total number of evictions from the cache.longThe total number of requests to the cache.floatThis is a measure of cache efficiency.longThe number of get requests that were satisfied by the cache.longA miss is a get request that is not satisfied.floatReturns the percentage of cache accesses that did not find a requested entry in the cache.longThe total number of puts to the cache.longThe total number of removals from the cache.longGets the cache creation time.longGets the last access time to cache.longGets the last update time to cache.Gets the Near Cache statistics.longReturns the owned entry count in the cache.
- 
Method Details- 
getCreationTimelong getCreationTime()Gets the cache creation time.- Returns:
- the cache creation time
 
- 
getLastAccessTimelong getLastAccessTime()Gets the last access time to cache.- Returns:
- the last access time to cache
 
- 
getLastUpdateTimelong getLastUpdateTime()Gets the last update time to cache.- Returns:
- the last update time to cache
 
- 
getOwnedEntryCountlong getOwnedEntryCount()Returns the owned entry count in the cache.- Returns:
- the owned entry count in the cache
 
- 
getCacheHitslong getCacheHits()The number of get requests that were satisfied by the cache.Cache.containsKey(Object)is not a get request for statistics purposes.In caches with multiple tiered storage, a hit may be implemented as a hit to the cache or to the first tier. For an EntryProcessor, a hit occurs when the key exists and an entry processor can be invoked against it, even if no methods ofCache.EntryorMutableEntryare called.- Returns:
- the number of hits (get requests that were satisfied by the cache)
 
- 
getCacheHitPercentagefloat getCacheHitPercentage()This is a measure of cache efficiency.It is calculated as: getCacheHits()divided by()* 100.- Returns:
- the percentage of successful hits as a decimal, such as 75
 
- 
getCacheMisseslong getCacheMisses()A miss is a get request that is not satisfied.In a simple cache, a miss occurs when the cache does not satisfy the request. Cache.containsKey(Object)is not a get request for statistics purposes.For an EntryProcessor, a miss occurs when the key does not exist and therefore an entry processor cannot be invoked against it.In caches with multiple tiered storage, a miss may be implemented as a miss to the cache or to the first tier. In a read-through cache, a miss is an absence of the key in the cache that will trigger a call to a CacheLoader. So it is still a miss even though the cache will load and return the value. Refer to the implementation for precise semantics. - Returns:
- the number of misses (get requests that were not satisfied)
 
- 
getCacheMissPercentagefloat getCacheMissPercentage()Returns the percentage of cache accesses that did not find a requested entry in the cache.This is calculated as getCacheMisses()divided bygetCacheGets()* 100.- Returns:
- the percentage of cache accesses that failed to find anything
 
- 
getCacheGetslong getCacheGets()The total number of requests to the cache. This will be equal to the sum of the hits and misses.A "get" is an operation that returns the current or previous value. It does not include checking for the existence of a key. In caches with multiple tiered storage, a get may be implemented as a get to the cache or to the first tier. - Returns:
- the number of gets to the cache
 
- 
getCachePutslong getCachePuts()The total number of puts to the cache.A put is counted even if it is immediately evicted. Replaces are where a put occurs which overrides an existing mapping, and they are counted as a put. - Returns:
- the number of puts to the cache
 
- 
getCacheRemovalslong getCacheRemovals()The total number of removals from the cache. This does not include evictions, where the cache itself initiates the removal to make space.- Returns:
- the number of removals from the cache
 
- 
getCacheEvictionslong getCacheEvictions()The total number of evictions from the cache. An eviction is a removal initiated by the cache itself to free up space. An eviction is not treated as a removal and does not appear in the removal counts.- Returns:
- the total number of evictions from the cache
 
- 
getAverageGetTimefloat getAverageGetTime()The mean time to execute gets.In a read-through cache, the time taken to load an entry on miss is not included in get time. - Returns:
- the mean time in microseconds to execute gets
 
- 
getAveragePutTimefloat getAveragePutTime()The mean time to execute puts.- Returns:
- the mean time in microseconds to execute puts
 
- 
getAverageRemoveTimefloat getAverageRemoveTime()The mean time to execute removes.- Returns:
- the mean time in microseconds to execute removes
 
- 
getNearCacheStatisticsNearCacheStats getNearCacheStatistics()Gets the Near Cache statistics.- Returns:
- the Near Cache statistics
 
- 
getReplicationStatsLocalReplicationStats getReplicationStats()- Returns:
- replication statistics.
- Since:
- 5.0
 
 
-