FileDocCategorySizeDatePackage
SecondLevelCacheStatistics.javaAPI DocHibernate 3.2.51885Thu Jun 09 01:33:06 BST 2005org.hibernate.stat

SecondLevelCacheStatistics

public class SecondLevelCacheStatistics extends CategorizedStatistics
Second level cache statistics of a specific region
author
Gavin King

Fields Summary
private transient org.hibernate.cache.Cache
cache
long
hitCount
long
missCount
long
putCount
Constructors Summary
SecondLevelCacheStatistics(org.hibernate.cache.Cache cache)

		super( cache.getRegionName() );
		this.cache = cache;
	
Methods Summary
public longgetElementCountInMemory()

		return cache.getElementCountInMemory();
	
public longgetElementCountOnDisk()

		return cache.getElementCountOnDisk();
	
public java.util.MapgetEntries()

		Map map = new HashMap();
		Iterator iter = cache.toMap().entrySet().iterator();
		while ( iter.hasNext() ) {
			Map.Entry me = (Map.Entry) iter.next();
			map.put( ( (CacheKey) me.getKey() ).getKey(), me.getValue() );
		}
		return map;
	
public longgetHitCount()

		return hitCount;
	
public longgetMissCount()

		return missCount;
	
public longgetPutCount()

		return putCount;
	
public longgetSizeInMemory()

		return cache.getSizeInMemory();
	
public java.lang.StringtoString()

		StringBuffer buf = new StringBuffer()
		    .append("SecondLevelCacheStatistics")
			.append("[hitCount=").append(this.hitCount)
			.append(",missCount=").append(this.missCount)
			.append(",putCount=").append(this.putCount);
		//not sure if this would ever be null but wanted to be careful
		if (this.cache != null) {
			buf.append(",elementCountInMemory=").append(this.getElementCountInMemory())
				.append(",elementCountOnDisk=").append(this.getElementCountOnDisk())
				.append(",sizeInMemory=").append(this.getSizeInMemory());
		}
		buf.append(']");
		return buf.toString();