Code example for Cache

Methods: sizestats

0
		this.cache = cache;
	} 
 
	@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());