IDEMPIERE-4405 Add basic cache statistics (#211)
fix wrong hit/miss count when cached value is null
This commit is contained in:
parent
147eebb01b
commit
0ad8737829
|
@ -303,7 +303,10 @@ public class CCache<K,V> implements CacheInterface, Map<K, V>, Serializable
|
|||
expire();
|
||||
V v = cache.get(key);
|
||||
if (v == null)
|
||||
m_miss.getAndAdd(1);
|
||||
if (nullList.contains(key))
|
||||
m_hit.getAndAdd(1);
|
||||
else
|
||||
m_miss.getAndAdd(1);
|
||||
else
|
||||
m_hit.getAndAdd(1);
|
||||
return v;
|
||||
|
|
Loading…
Reference in New Issue