public class CacheStatistics extends Object implements CacheStatisticsMXBean
Constructor and Description |
---|
CacheStatistics() |
Modifier and Type | Method and Description |
---|---|
void |
addCacheEvictions(long cacheEvictions) |
void |
addCacheGets(long cacheGets) |
void |
addCacheHits(long cacheHits) |
void |
addCacheMisses(long cacheMisses) |
void |
addCachePuts(long cachePuts) |
void |
addCacheRemovals(long cacheRemovals) |
long |
getCacheEvictions()
Returns the total number of evictions from the cache.
|
long |
getCacheGets()
Returns the total number of get requests to the cache.
|
float |
getCacheHitPercentage()
This is a percentage representation of the positive cache efficiency, by computing how many get
requests resulted in a hit in contrast to all get requests.
|
float |
getCacheHitRatio()
This is a measure of cache efficiency.
|
long |
getCacheHits()
Returns the number of get requests the cache found an entry for.
|
long |
getCacheMisses()
Returns the number of get requests the cache found NO entry for.
|
float |
getCacheMissPercentage()
This is a percentage representation of the negative cache efficiency, by computing for how many
get requests no entry was found in contrast to all get requests .
|
float |
getCacheMissRatio()
Returns the ratio of cache accesses that did not find a requested entry in the cache.
|
long |
getCachePuts()
Returns the total number of put requests to the cache.
|
long |
getCacheRemovals()
Returns the total number of removal requests to the cache.
|
void |
reset()
Clears the statistics counters to 0 for the associated Cache.
|
public long getCacheHits()
CacheStatisticsMXBean
getCacheHits
in interface CacheStatisticsMXBean
public void addCacheHits(long cacheHits)
public long getCacheMisses()
CacheStatisticsMXBean
getCacheMisses
in interface CacheStatisticsMXBean
public void addCacheMisses(long cacheMisses)
public long getCacheGets()
CacheStatisticsMXBean
Note that this includes cache misses and hits and doesn't respect whether a key was found or not!
getCacheGets
in interface CacheStatisticsMXBean
public void addCacheGets(long cacheGets)
public long getCachePuts()
CacheStatisticsMXBean
Note that every put request is counted, even those who are immediately evicted.
getCachePuts
in interface CacheStatisticsMXBean
public void addCachePuts(long cachePuts)
public long getCacheRemovals()
CacheStatisticsMXBean
Note that that every remove request is being counted, even those where nothing was removed.
This doens't include evictions. For evictions refer to CacheStatisticsMXBean.getCacheEvictions()
getCacheRemovals
in interface CacheStatisticsMXBean
public void addCacheRemovals(long cacheRemovals)
public long getCacheEvictions()
CacheStatisticsMXBean
An eviction is an automatic removal of an cache entry in order to free space.
getCacheEvictions
in interface CacheStatisticsMXBean
public void addCacheEvictions(long cacheEvictions)
public float getCacheHitRatio()
It is calculated as: getCacheHits()
divided by ()
.
Attention: Not thread safe since both gets can differ in time
public float getCacheMissRatio()
This is calculated as getCacheMisses()
divided by getCacheGets()
.
Attention: Not thread save since both gets can differ in time
public void reset()
reset
in interface CacheStatisticsMXBean
public float getCacheHitPercentage()
CacheStatisticsMXBean
It calculates as: (CacheStatisticsMXBean.getCacheHits()
/ ()
) * 100.
getCacheHitPercentage
in interface CacheStatisticsMXBean
public float getCacheMissPercentage()
CacheStatisticsMXBean
It calculates as: (CacheStatisticsMXBean.getCacheMisses()
/ ()
) * 100.
getCacheMissPercentage
in interface CacheStatisticsMXBean
Copyright © 2024 levigo holding gmbh. All rights reserved.