类 DefaultCacheStatistics
- java.lang.Object
- org.springframework.boot.actuate.cache.DefaultCacheStatistics
- 所有已实现的接口:
CacheStatistics
public class DefaultCacheStatistics extends Object implements CacheStatistics
A defaultCacheStatisticsimplementation.- 从以下版本开始:
- 1.3.0
构造器概要
构造器 构造器 说明 DefaultCacheStatistics()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 DoublegetHitRatio()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%.DoublegetMissRatio()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%.LonggetSize()Return the size of the cache ornullif that information is not available.voidsetGetCacheCounts(long hitCount, long missCount)voidsetHitRatio(Double hitRatio)voidsetMissRatio(Double missRatio)voidsetSize(Long size)Collection<Metric<?>>toMetrics(String prefix)Generate the relevantMetricinstances based on the specified prefix.
构造器详细资料
DefaultCacheStatistics
public DefaultCacheStatistics()
方法详细资料
toMetrics
public Collection<Metric<?>> toMetrics(String prefix)
从接口复制的说明:CacheStatisticsGenerate the relevantMetricinstances based on the specified prefix.- 指定者:
toMetrics在接口中CacheStatistics- 参数:
prefix- the metrics prefix (ends with '.')- 返回:
- the metrics corresponding to this instance
setGetCacheCounts
public void setGetCacheCounts(long hitCount, long missCount)
getSize
public Long getSize()
从接口复制的说明:CacheStatisticsReturn the size of the cache ornullif that information is not available.- 指定者:
getSize在接口中CacheStatistics- 返回:
- the size of the cache or
null
getHitRatio
public Double getHitRatio()
从接口复制的说明:CacheStatisticsReturn 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%.This may also return
nullif the cache-specifics statistics does not provide the necessary information- 指定者:
getHitRatio在接口中CacheStatistics- 返回:
- the hit ratio or
null
setHitRatio
public void setHitRatio(Double hitRatio)
getMissRatio
public Double getMissRatio()
从接口复制的说明:CacheStatisticsReturn 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%.This may also return
nullif the cache-specifics statistics does not provide the necessary information- 指定者:
getMissRatio在接口中CacheStatistics- 返回:
- the miss ratio or
null
setMissRatio
public void setMissRatio(Double missRatio)