Record Class CacheHealthIndicator.CacheHealth

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.spring.CacheHealthIndicator.CacheHealth
Record Components:
status - the health status | 健康状态
size - the cache size | 缓存大小
hitCount - the hit count | 命中次数
missCount - the miss count | 未命中次数
evictionCount - the eviction count | 淘汰次数
hitRate - the hit rate | 命中率
missRate - the miss rate | 未命中率
warning - the warning message, if any | 警告消息(如有)
Enclosing class:
CacheHealthIndicator

public static record CacheHealthIndicator.CacheHealth(CacheHealthIndicator.Status status, long size, long hitCount, long missCount, long evictionCount, double hitRate, double missRate, String warning) extends Record
Individual cache health 单个缓存健康
Since:
JDK 25, opencode-base-cache V2.0.4
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • CacheHealth

      public CacheHealth(CacheHealthIndicator.Status status, long size, long hitCount, long missCount, long evictionCount, double hitRate, double missRate, String warning)
      Creates an instance of a CacheHealth record class.
      Parameters:
      status - the value for the status record component
      size - the value for the size record component
      hitCount - the value for the hitCount record component
      missCount - the value for the missCount record component
      evictionCount - the value for the evictionCount record component
      hitRate - the value for the hitRate record component
      missRate - the value for the missRate record component
      warning - the value for the warning record component
  • Method Details

    • toMap

      public Map<String,Object> toMap()
      Convert to map for JSON serialization 转换为 Map 用于 JSON 序列化
      Returns:
      map representation | Map 表示
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • status

      public CacheHealthIndicator.Status status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • size

      public long size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • hitCount

      public long hitCount()
      Returns the value of the hitCount record component.
      Returns:
      the value of the hitCount record component
    • missCount

      public long missCount()
      Returns the value of the missCount record component.
      Returns:
      the value of the missCount record component
    • evictionCount

      public long evictionCount()
      Returns the value of the evictionCount record component.
      Returns:
      the value of the evictionCount record component
    • hitRate

      public double hitRate()
      Returns the value of the hitRate record component.
      Returns:
      the value of the hitRate record component
    • missRate

      public double missRate()
      Returns the value of the missRate record component.
      Returns:
      the value of the missRate record component
    • warning

      public String warning()
      Returns the value of the warning record component.
      Returns:
      the value of the warning record component