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 Summary
ConstructorsConstructorDescriptionCacheHealth(CacheHealthIndicator.Status status, long size, long hitCount, long missCount, long evictionCount, double hitRate, double missRate, String warning) Creates an instance of aCacheHealthrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.longReturns the value of theevictionCountrecord component.final inthashCode()Returns a hash code value for this object.longhitCount()Returns the value of thehitCountrecord component.doublehitRate()Returns the value of thehitRaterecord component.longReturns the value of themissCountrecord component.doublemissRate()Returns the value of themissRaterecord component.longsize()Returns the value of thesizerecord component.status()Returns the value of thestatusrecord component.toMap()Convert to map for JSON serialization 转换为 Map 用于 JSON 序列化final StringtoString()Returns a string representation of this record class.warning()Returns the value of thewarningrecord component.
-
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 aCacheHealthrecord class.- Parameters:
status- the value for thestatusrecord componentsize- the value for thesizerecord componenthitCount- the value for thehitCountrecord componentmissCount- the value for themissCountrecord componentevictionCount- the value for theevictionCountrecord componenthitRate- the value for thehitRaterecord componentmissRate- the value for themissRaterecord componentwarning- the value for thewarningrecord component
-
-
Method Details
-
toMap
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
status
-
size
-
hitCount
-
missCount
-
evictionCount
public long evictionCount()Returns the value of theevictionCountrecord component.- Returns:
- the value of the
evictionCountrecord component
-
hitRate
-
missRate
-
warning
-