Record Class MultiLevelCache.MultiLevelStats
java.lang.Object
java.lang.Record
cloud.opencode.base.cache.multilevel.MultiLevelCache.MultiLevelStats
- Record Components:
totalHits- the total number of hits across all levels | 所有级别的总命中数totalMisses- the total number of misses | 总未命中数totalPromotions- the total number of promotions | 总提升数levelStats- per-level statistics snapshots | 每级统计快照
- Enclosing class:
MultiLevelCache<K,V>
public static record MultiLevelCache.MultiLevelStats(long totalHits, long totalMisses, long totalPromotions, Map<String, MultiLevelCache.LevelMetrics.Snapshot> levelStats)
extends Record
Multi-level statistics
多级统计
- Since:
- JDK 25, opencode-base-cache V2.0.5
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionMultiLevelStats(long totalHits, long totalMisses, long totalPromotions, Map<String, MultiLevelCache.LevelMetrics.Snapshot> levelStats) Creates an instance of aMultiLevelStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thelevelStatsrecord component.doubleoverallHitRate | overallHitRatefinal StringtoString()Returns a string representation of this record class.longReturns the value of thetotalHitsrecord component.longReturns the value of thetotalMissesrecord component.longReturns the value of thetotalPromotionsrecord component.
-
Constructor Details
-
MultiLevelStats
public MultiLevelStats(long totalHits, long totalMisses, long totalPromotions, Map<String, MultiLevelCache.LevelMetrics.Snapshot> levelStats) Creates an instance of aMultiLevelStatsrecord class.- Parameters:
totalHits- the value for thetotalHitsrecord componenttotalMisses- the value for thetotalMissesrecord componenttotalPromotions- the value for thetotalPromotionsrecord componentlevelStats- the value for thelevelStatsrecord component
-
-
Method Details
-
overallHitRate
public double overallHitRate()overallHitRate | overallHitRate- Returns:
- the result | 结果
-
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. -
totalHits
-
totalMisses
public long totalMisses()Returns the value of thetotalMissesrecord component.- Returns:
- the value of the
totalMissesrecord component
-
totalPromotions
public long totalPromotions()Returns the value of thetotalPromotionsrecord component.- Returns:
- the value of the
totalPromotionsrecord component
-
levelStats
Returns the value of thelevelStatsrecord component.- Returns:
- the value of the
levelStatsrecord component
-