public class CacheStatisticsImpl extends Object implements DataSerializable, CacheStatistics
ICache
Statistics accumulated in this data object is published through MxBeanCacheMXBeanImpl| Constructor and Description |
|---|
CacheStatisticsImpl() |
| Modifier and Type | Method and Description |
|---|---|
CacheStatisticsImpl |
accumulate(CacheStatisticsImpl other)
Simple CacheStatistics adder.
|
void |
addGetTimeNano(long duration)
Increments the getCache time accumulator
|
void |
addPutTimeNano(long duration)
Increments the put time accumulator
|
void |
addRemoveTimeNano(long duration)
Increments the remove time accumulator
|
void |
clear()
implementation of
CacheStatisticsMXBean.clear() |
float |
getAverageGetTime()
The mean time to execute gets.
|
float |
getAveragePutTime()
The mean time to execute puts.
|
float |
getAverageRemoveTime()
The mean time to execute removes.
|
long |
getCacheEvictions()
The total number of evictions from the cache.
|
long |
getCacheExpiries()
The total number of expiries from the cache.
|
long |
getCacheGets()
The total number of requests to the cache.
|
long |
getCacheGetTimeTakenNanos() |
float |
getCacheHitPercentage()
This is a measure of cache efficiency.
|
long |
getCacheHits()
The number of get requests that were satisfied by the cache.
|
long |
getCacheMisses()
A miss is a get request that is not satisfied.
|
float |
getCacheMissPercentage()
Returns the percentage of cache accesses that did not find a requested entry
in the cache.
|
long |
getCachePuts()
The total number of puts to the cache.
|
long |
getCachePutTimeTakenNanos() |
long |
getCacheRemovals()
The total number of removals from the cache.
|
long |
getCacheRemoveTimeTakenNanos() |
void |
increaseCacheEvictions(long number)
Increases the counter by the number specified.
|
void |
increaseCacheExpiries(long number)
Increases the counter by the number specified.
|
void |
increaseCacheHits(long number)
Increases the counter by the number specified.
|
void |
increaseCacheMisses(long number)
Increases the counter by the number specified.
|
void |
increaseCachePuts(long number)
Increases the counter by the number specified.
|
void |
increaseCacheRemovals(long number)
Increases the counter by the number specified.
|
void |
readData(ObjectDataInput in)
Reads fields from the input stream
|
void |
writeData(ObjectDataOutput out)
Writes object fields to output stream
|
public long getCacheRemovals()
getCacheRemovals in interface CacheStatisticspublic long getCacheExpiries()
public long getCacheGets()
A "get" is an operation that returns the current or previous value. It does not include checking for the existence of a key.
In a caches with multiple tiered storage, a gets may be implemented as a get to the cache or to the first tier.
getCacheGets in interface CacheStatisticspublic long getCachePuts()
A put is counted even if it is immediately evicted.
Replaces, where a put occurs which overrides an existing mapping is counted as a put.
getCachePuts in interface CacheStatisticspublic long getCacheHits()
Cache.containsKey(Object) is not a get request for
statistics purposes.
In a 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 of Cache.Entry or
MutableEntry are called.
getCacheHits in interface CacheStatisticspublic long getCacheMisses()
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 a 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.
getCacheMisses in interface CacheStatisticspublic long getCacheEvictions()
getCacheEvictions in interface CacheStatisticspublic long getCachePutTimeTakenNanos()
public long getCacheGetTimeTakenNanos()
public long getCacheRemoveTimeTakenNanos()
public float getCacheHitPercentage()
It is calculated as:
CacheStatistics.getCacheHits() divided by () * 100.
getCacheHitPercentage in interface CacheStatisticspublic float getCacheMissPercentage()
This is calculated as CacheStatistics.getCacheMisses() divided by
CacheStatistics.getCacheGets() * 100.
getCacheMissPercentage in interface CacheStatisticspublic float getAverageGetTime()
In a read-through cache the time taken to load an entry on miss is not included in get time.
getAverageGetTime in interface CacheStatisticspublic float getAveragePutTime()
getAveragePutTime in interface CacheStatisticspublic float getAverageRemoveTime()
getAverageRemoveTime in interface CacheStatisticspublic void clear()
CacheStatisticsMXBean.clear()CacheStatisticsMXBean.clear()public void increaseCacheRemovals(long number)
number - the number to increase the counter bypublic void increaseCacheExpiries(long number)
number - the number to increase the counter bypublic void increaseCachePuts(long number)
number - the number to increase the counter bypublic void increaseCacheHits(long number)
number - the number to increase the counter bypublic void increaseCacheMisses(long number)
number - the number to increase the counter bypublic void increaseCacheEvictions(long number)
number - the number to increase the counter bypublic void addGetTimeNano(long duration)
duration - the time taken in nanosecondspublic void addPutTimeNano(long duration)
duration - the time taken in nanosecondspublic void addRemoveTimeNano(long duration)
duration - the time taken in nanosecondspublic CacheStatisticsImpl accumulate(CacheStatisticsImpl other)
other - CacheStatisticsImpl to be mergedpublic void writeData(ObjectDataOutput out) throws IOException
DataSerializablewriteData in interface DataSerializableout - outputIOExceptionpublic void readData(ObjectDataInput in) throws IOException
readData in interface DataSerializablein - inputIOExceptionCopyright © 2014 Hazelcast, Inc.. All Rights Reserved.