EHC ❯ Eviction count always comes as zero
-
Bug
-
Status: Closed
-
2 Major
-
Resolution: Cannot Reproduce
-
ehcache
-
-
alexsnaps
-
Reporter: sandy801
-
November 30, 2011
-
0
-
Watchers: 0
-
July 27, 2012
-
December 21, 2011
Description
i am using ehcache 2.4, with statistics enabled. Just to check that there is issue with cache stats I have cache of size 5 elements. i add around 10 elements which means atleast 5 elements are evicted from cache. But eviction count (getEvictionCount() api of Statistics class) always returns zero.
here is default and custom region config. i used to test on “app1cache” region.
Added a note on the originating forum post as well http://forums.terracotta.org/forums/posts/list/0/6197.page#32355
If nothing comes from the user, I’d be tempted to close this as “Not reproducible”
Closing per Alex comments
Creating a cacheManager with your settings above (even though the cache app1cache either misses some other elements, or isn’t closed!) and running: {noformat} final Cache cache = cacheManager.getCache(“app1cache”); for(int i = 0; i < 10; i++) { cache.put(new Element(i, “value” +i)); } assertThat(cache.getStatistics().getEvictionCount(), is(5L));{noformat}
passes… What am I missing ?