接口 CacheStatistics

  • 所有已知实现类:
    DefaultCacheStatistics

    public interface CacheStatistics
    Snapshot of the statistics of a given cache. CacheStatistics instances have a very short life as it represents the statistics of a cache at one particular point in time.
    从以下版本开始:
    1.3.0
    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型方法说明
      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 or null if that information is not available.
      Collection<Metric<?>>toMetrics​(String prefix)
      Generate the relevant Metric instances based on the specified prefix.
    • 方法详细资料

      • toMetrics

        Collection<Metric<?>> toMetrics​(String prefix)
        Generate the relevant Metric instances based on the specified prefix.
        参数:
        prefix - the metrics prefix (ends with '.')
        返回:
        the metrics corresponding to this instance
      • getSize

        Long getSize()
        Return the size of the cache or null if that information is not available.
        返回:
        the size of the cache or null
      • getHitRatio

        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%.

        This may also return null if the cache-specifics statistics does not provide the necessary information

        返回:
        the hit ratio or null
      • getMissRatio

        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%.

        This may also return null if the cache-specifics statistics does not provide the necessary information

        返回:
        the miss ratio or null