0
是否有任何方法或任何參數可用於查找要緩存的命中數。我們正在爲我們的應用程序使用Ehcache。感謝在這方面的任何幫助。緩存命中(ehCache)
是否有任何方法或任何參數可用於查找要緩存的命中數。我們正在爲我們的應用程序使用Ehcache。感謝在這方面的任何幫助。緩存命中(ehCache)
你看過Cache.getStatistics()嗎?
http://ehcache.org/apidocs/net/sf/ehcache/Cache.html#getStatistics() http://ehcache.org/apidocs/net/sf/ehcache/Statistics.html
Cache cache = cacheManager.getCache("someCache");
Statistics stats = cache.getStatistics();
long hits = stats.getInMemoryHits();
long misses = stats.getInMemoryMisses();