public class EhCacheStatistics extends java.lang.Object implements CacheStatistics
Constructor and Description |
---|
EhCacheStatistics(net.sf.ehcache.Cache cache)
Creates a new instance that delegates statistics inquiries to the given
Cache instance. |
Modifier and Type | Method and Description |
---|---|
long |
getCapacity()
Gets the heap memory capacity of the cache.
|
long |
getEvictions()
Gets the number of items evicted from the cache in order to make space for new items.
|
java.lang.String |
getName()
Gets a descriptive name of the cache instance for which statistics apply.
|
long |
getPercentFree()
Gets the percent free capacity remaining in the cache.
|
long |
getSize()
Gets the size of heap consumed by items stored in the cache.
|
java.lang.String |
toString(java.lang.StringBuilder builder)
Writes a string representation of cache statistics to the given string builder.
|
public EhCacheStatistics(net.sf.ehcache.Cache cache)
Cache
instance.cache
- Cache instance for which to gather statistics.public long getSize()
getSize
in interface CacheStatistics
public long getCapacity()
getCapacity
in interface CacheStatistics
public long getEvictions()
CacheStatistics
getEvictions
in interface CacheStatistics
public long getPercentFree()
CacheStatistics
getPercentFree
in interface CacheStatistics
public java.lang.String getName()
CacheStatistics
getName
in interface CacheStatistics
public java.lang.String toString(java.lang.StringBuilder builder)
CacheStatistics
toString
in interface CacheStatistics
builder
- String builder to which string representation is appended.