public class SimpleCacheStatistics extends Object implements CacheStatistics
| Constructor and Description |
|---|
SimpleCacheStatistics(long size,
long capacity,
long evictions)
Creates a new instance with given parameters.
|
SimpleCacheStatistics(long size,
long capacity,
long evictions,
String name)
Creates a new named instance with given parameters.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCapacity()
Gets the current capacity of the cache in a unit specific to the cache being monitored (e.g.
|
long |
getEvictions()
Gets the number of items evicted from the cache in order to make space for new items.
|
String |
getName()
Gets a descriptive name of the cache instance for which statistics apply.
|
int |
getPercentFree()
Gets the percent free capacity remaining in the cache.
|
long |
getSize()
Gets the current size of the cache in a unit specific to the cache being monitored (e.g.
|
void |
toString(StringBuilder builder)
Writes a string representation of cache statistics to the given string builder.
|
public SimpleCacheStatistics(long size,
long capacity,
long evictions)
size - Current cache size (e.g. items, bytes, etc).capacity - Current cache capacity (e.g. items, bytes, etc). The units of capacity must be equal to size
in order to produce a meaningful value for getPercentFree().evictions - Number of evictions reported by cache.public SimpleCacheStatistics(long size,
long capacity,
long evictions,
String name)
size - Current cache size (e.g. items, bytes, etc).capacity - Current cache capacity (e.g. items, bytes, etc). The units of capacity must be equal to size
in order to produce a meaningful value for getPercentFree().evictions - Number of evictions reported by cache.name - Name of cache instance to which statistics apply.public long getSize()
CacheStatisticsgetSize in interface CacheStatisticspublic long getCapacity()
CacheStatisticsgetCapacity in interface CacheStatisticspublic long getEvictions()
CacheStatisticsgetEvictions in interface CacheStatisticspublic int getPercentFree()
CacheStatisticsgetPercentFree in interface CacheStatisticspublic void toString(StringBuilder builder)
CacheStatisticstoString in interface CacheStatisticsbuilder - String builder to which string representation is appended.public String getName()
getName in interface CacheStatisticsCopyright © 2004-2015 Apereo. All Rights Reserved.