Package com.google.common.cache

Examples of com.google.common.cache.CacheStats


            loadSuccessCount += s.loadSuccessCount;
            loadExceptionCount += s.loadExceptionCount;
            totalLoadTime += s.totalLoadTime;
            evictionCount += s.evictionCount;
        }
        CacheStats stats = new CacheStats(hitCount, missCount, loadSuccessCount,
                loadExceptionCount, totalLoadTime, evictionCount);
        return stats;
    }
View Full Code Here


    }

    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("");
        }
    }
View Full Code Here

            loadSuccessCount += s.loadSuccessCount;
            loadExceptionCount += s.loadExceptionCount;
            totalLoadTime += s.totalLoadTime;
            evictionCount += s.evictionCount;
        }
        CacheStats stats = new CacheStats(hitCount, missCount, loadSuccessCount,
                loadExceptionCount, totalLoadTime, evictionCount);
        return stats;
    }
View Full Code Here

            loadSuccessCount += s.loadSuccessCount;
            loadExceptionCount += s.loadExceptionCount;
            totalLoadTime += s.totalLoadTime;
            evictionCount += s.evictionCount;
        }
        CacheStats stats = new CacheStats(hitCount, missCount, loadSuccessCount,
                loadExceptionCount, totalLoadTime, evictionCount);
        return stats;
    }
View Full Code Here

       
       
    }
   
    private String getStats(CachedRuleReader cacheRuleReader) {
        CacheStats stats = cacheRuleReader.getStats();
        return new StringBuilder()
                .append("<b>RuleStats</b><ul>")
                .append("<li>size: ").append(cacheRuleReader.getCacheSize())
                    .append("/")
                    .append(cacheRuleReader.getCacheInitParams().getSize()).append("</li>")
                .append("<li>hitCount: ").append(stats.hitCount()).append("</li>")
                .append("<li>missCount: ").append(stats.missCount()).append("</li>")
                .append("<li>loadSuccessCount: ").append(stats.loadSuccessCount()).append("</li>")
                .append("<li>loadExceptionCount: ").append(stats.loadExceptionCount()).append("</li>")
                .append("<li>totalLoadTime: ").append(stats.totalLoadTime()).append("</li>")
                .append("<li>evictionCount: ").append(stats.evictionCount()).append("</li>")
                .append("</ul>").toString();
       
    }
View Full Code Here

                .append("</ul>").toString();
       
    }

    private String getUserStats(CachedRuleReader cacheRuleReader) {
        CacheStats stats;
        StringBuilder sb;
        stats = cacheRuleReader.getUserStats();
        sb = new StringBuilder().append("<b>UserStats</b><ul>")
                .append("<li>size: ").append(cacheRuleReader.getUserCacheSize())
                    .append("/")
                    .append(cacheRuleReader.getCacheInitParams().getSize()).append("</li>")
                .append("<li>hitCount: ").append(stats.hitCount()).append("</li>")
                .append("<li>missCount: ").append(stats.missCount()).append("</li>")
                .append("<li>loadSuccessCount: ").append(stats.loadSuccessCount()).append("</li>")
                .append("<li>loadExceptionCount: ").append(stats.loadExceptionCount()).append("</li>")
                .append("<li>totalLoadTime: ").append(stats.totalLoadTime()).append("</li>")
                .append("<li>evictionCount: ").append(stats.evictionCount()).append("</li>")
                .append("</ul>");
        return sb.toString();
    }
View Full Code Here

    @Override
    public void handleGet() {
        //        Representation representation = new StringRepresentation(stats.toString());
        //        getResponse().setEntity(representation);
        CacheStats stats = crr.getStats();

        StringBuilder sb = new StringBuilder()
                .append("RuleStats[")
                .append(" size:").append(crr.getCacheSize())
                .append("/").append(crr.getCacheInitParams().getSize())
                .append(" hitCount:").append(stats.hitCount())
                .append(" missCount:").append(stats.missCount())
                .append(" loadSuccessCount:").append(stats.loadSuccessCount())
                .append(" loadExceptionCount:").append(stats.loadExceptionCount())
                .append(" totalLoadTime:").append(stats.totalLoadTime())
                .append(" evictionCount:").append(stats.evictionCount())
                .append("] \n");

        stats = crr.getUserStats();
        sb.append("UserStats[")
                .append(" size:").append(crr.getUserCacheSize())
                .append("/").append(crr.getCacheInitParams().getSize())
                .append(" hitCount:").append(stats.hitCount())
                .append(" missCount:").append(stats.missCount())
                .append(" loadSuccessCount:").append(stats.loadSuccessCount())
                .append(" loadExceptionCount:").append(stats.loadExceptionCount())
                .append(" totalLoadTime:").append(stats.totalLoadTime())
                .append(" evictionCount:").append(stats.evictionCount())
                .append("] \n");

       getResponse().setEntity(new StringRepresentation(sb));
    }
View Full Code Here

TOP

Related Classes of com.google.common.cache.CacheStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.