Search in sources :

Example 11 with CacheStats

use of com.google.common.cache.CacheStats in project platformlayer by platformlayer.

the class CacheMetricsReporter method addMetrics.

@Override
public void addMetrics(MetricTreeObject tree) {
    long size = cache.size();
    CacheStats stats = cache.stats();
    MetricTreeObject subtree = tree.getSubtree(key);
    subtree.addInt("size", size);
    subtree.addInt("evictionCount", stats.evictionCount());
    subtree.addInt("hitCount", stats.hitCount());
    subtree.addInt("loadCount", stats.loadCount());
    subtree.addInt("loadExceptionCount", stats.loadExceptionCount());
    subtree.addInt("loadSuccessCount", stats.loadSuccessCount());
    subtree.addInt("missCount", stats.missCount());
    subtree.addInt("requestCount", stats.requestCount());
    subtree.addInt("totalLoadTime", stats.totalLoadTime());
    subtree.addFloat("averageLoadPenalty", stats.averageLoadPenalty());
    subtree.addFloat("hitRate", stats.hitRate());
    subtree.addFloat("loadExceptionRate", stats.loadExceptionRate());
    subtree.addFloat("missRate", stats.missRate());
}
Also used : CacheStats(com.google.common.cache.CacheStats)

Aggregations

CacheStats (com.google.common.cache.CacheStats)11 Test (org.junit.Test)3 HashMap (java.util.HashMap)2 DataSource (javax.sql.DataSource)2 BeanFactory (org.springframework.beans.factory.BeanFactory)2 Expression (org.springframework.expression.Expression)2 ExpressionFactoryBean (org.springframework.integration.config.ExpressionFactoryBean)2 SimplePerfEvent (com.facebook.buck.event.SimplePerfEvent)1 AbstractDaemonTest (com.google.gerrit.acceptance.AbstractDaemonTest)1 PushOneCommit (com.google.gerrit.acceptance.PushOneCommit)1 LinkedHashMap (java.util.LinkedHashMap)1 CompositeDataSupport (javax.management.openmbean.CompositeDataSupport)1 CompositeType (javax.management.openmbean.CompositeType)1 TabularDataSupport (javax.management.openmbean.TabularDataSupport)1 TabularType (javax.management.openmbean.TabularType)1 ManagedMetric (org.springframework.jmx.export.annotation.ManagedMetric)1