Guava CacheStats - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Guava CacheStats class.

This code example shows how to use the following methods:evictionCount, hitCount, loadExceptionCount, loadSuccessCount, missCount
 
        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));
    } 
} 
8
CodeRank
This code example shows how to use the following methods:averageLoadPenalty, evictionCount, hitCount, hitRate, loadCount
		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());
	} 
} 

3
CodeRank
This code example shows how to use the following methods:
      client.atomicIncrement(req).chain(amount.deferred);
    } 
 
  } 
 
  static final CacheStats ZERO_STATS = new CacheStats(0, 0, 0, 0, 0, 0);
 
} 
3
CodeRank
See Code Examples for Guava CacheStats Methods: