Terracotta 10.11 | Ehcache API Developer Guide | Management and Monitoring with Ehcache | Rules for Statistics Calculation
 
Rules for Statistics Calculation
This table describes the impact of each cache method on the statistics.
The statistics are:
Hit
An entry was asked for and found in the cache.
Miss
An entry was asked for and not found in the cache.
Put
An entry was added or updated.
Update
An existing entry was updated (this is a subset of put).
Removal
An entry was removed from the cache.
Expiration
An entry has expired and was therefore removed from the cache.
Eviction
An entry was evicted from the cache due to lack of space
Method
Hit
Miss
Put
Update
Removal
Expiration
Eviction
Notes
clear
No
No
No
No
No
No
No
A bulk remove with no impact on statistics.
containsKey
No
No
No
No
No
No
No
Generates no hit or miss since the value isn't accessed.
forEach
Yes
No
No
No
No
Yes
No
Java 8. Will hit each entry once.
get
Yes
Yes
No
No
No
Yes
No
Hit when the entry is found, miss otherwise.
getAll
Yes
Yes
No
No
No
Yes
No
Like get but calculated per entry.
getAndPut
Yes
Yes
Yes
Yes
No
Yes
Yes
JSR107 specific. Hit and update when the entry is found, miss otherwise. Always put.
getAndRemove
Yes
Yes
No
No
Yes
Yes
No
JSR107 specific. Hit and remove when the entry is found, miss otherwise.
getAndReplace
Yes
Yes
Yes
Yes
No
Yes
Yes
JSR107 specific. Hit, put and update when the entry is found, miss otherwise.
invoke
Yes
Yes
Yes
Yes
Yes
Yes
Yes
JSR107 specific. Depends on how the EntryProcessor modifies the MutableEntry.
invokeAll
Yes
Yes
Yes
Yes
Yes
Yes
Yes
JSR107 specific. Like invoke but calculated per entry.
iterator
Yes
No
No
No
Yes
Yes
No
Will hit each iterated entry and count a removal on Iterator.remove.
loadAll
No
No
No
No
No
No
No
JSR107 specific. Background loading that has no impact on statistics.
put
No
No
Yes
Yes
No
No
Yes
Put an entry whether it already existed or not.
putAll
No
No
Yes
Yes
No
No
Yes
Like put but calculated per entry.
putIfAbsent
Yes
Yes
Yes
No
No
Yes
Yes
Will hit if the entry exists. Will put and miss if it doesn't.
remove(K)
No
No
No
No
Yes
Yes
No
Count a removal if the entry exists.
remove(K,V)
Yes
Yes
No
No
Yes
Yes
No
Hit if the key is found. Miss otherwise.
removeAll
No
No
No
No
Yes
No
No
One removal per entry in the cache.
removeAll(keys)
No
No
No
No
Yes
No
No
Like remove but calculated per entry.
replace(K,V)
Yes
Yes
Yes
Yes
No
Yes
Yes
Hit, put and update if the entry exists. Miss otherwise.
replace(K,O,N)
Yes
Yes
Yes
Yes
No
Yes
Yes
Hit if the entry exists.
spliterator
Yes
No
No
No
No
Yes
No
Java 8. Will hit for each iterated entry.
The statistics are provided by cache and tiers. Cache evictions and expirations are taken from the lowest (authoritative) tier.