public class DefaultCacheStatistics extends Object implements CacheStatistics
CacheStatistics
implementation.Constructor and Description |
---|
DefaultCacheStatistics() |
Modifier and Type | Method and Description |
---|---|
Double |
getHitRatio()
Return the ratio of cache requests which were hits as a value between 0 and 1 where
0 means that the hit ratio is 0% and 1 means it is 100%.
|
Double |
getMissRatio()
Return the ratio of cache requests which were misses as value between 0 and 1 where
0 means that the miss ratio is 0% and 1 means it is 100%.
|
Long |
getSize()
Return the size of the cache or
null if that information is not available. |
void |
setGetCacheCounts(long hitCount,
long missCount) |
void |
setHitRatio(Double hitRatio) |
void |
setMissRatio(Double missRatio) |
void |
setSize(Long size) |
Collection<Metric<?>> |
toMetrics(String prefix)
Generate the relevant
Metric instances based on the specified prefix. |
public Collection<Metric<?>> toMetrics(String prefix)
CacheStatistics
Metric
instances based on the specified prefix.toMetrics
in interface CacheStatistics
prefix
- the metrics prefix (ends with '.')public void setGetCacheCounts(long hitCount, long missCount)
public Long getSize()
CacheStatistics
null
if that information is not available.getSize
in interface CacheStatistics
null
public void setSize(Long size)
public Double getHitRatio()
CacheStatistics
This may also return null
if the cache-specifics statistics does not
provide the necessary information
getHitRatio
in interface CacheStatistics
null
public void setHitRatio(Double hitRatio)
public Double getMissRatio()
CacheStatistics
This may also return null
if the cache-specifics statistics does not
provide the necessary information
getMissRatio
in interface CacheStatistics
null
public void setMissRatio(Double missRatio)
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.