}
private void displayCacheStatistics(Cache<StatementCacheKey, PreparedStatement> dynamicPSCache) {
long cacheSize = dynamicPSCache.size();
CacheStats cacheStats = dynamicPSCache.stats();
log.info("Total LRU cache size {}", cacheSize);
if (cacheSize > (maxLRUCacheSize * 0.8)) {
log.warn("Warning, the LRU prepared statements cache is over 80% full");
}
if (log.isDebugEnabled()) {
log.debug("Cache statistics :");
log.debug("\t\t- hits count : {}", cacheStats.hitCount());
log.debug("\t\t- hits rate : {}", cacheStats.hitRate());
log.debug("\t\t- miss count : {}", cacheStats.missCount());
log.debug("\t\t- miss rate : {}", cacheStats.missRate());
log.debug("\t\t- eviction count : {}", cacheStats.evictionCount());
log.debug("\t\t- load count : {}", cacheStats.loadCount());
log.debug("\t\t- load success count : {}", cacheStats.loadSuccessCount());
log.debug("\t\t- load exception count : {}", cacheStats.loadExceptionCount());
log.debug("\t\t- total load time : {}", cacheStats.totalLoadTime());
log.debug("\t\t- average load penalty : {}", cacheStats.averageLoadPenalty());
log.debug("");
log.debug("");
}
}