Record Class MultiLevelCache.LevelMetrics.Snapshot
java.lang.Object
java.lang.Record
cloud.opencode.base.cache.multilevel.MultiLevelCache.LevelMetrics.Snapshot
- Record Components:
levelName- the level name | 级别名称hits- the hit count | 命中数misses- the miss count | 未命中数promotions- the promotion count | 提升数
- Enclosing class:
MultiLevelCache.LevelMetrics
public static record MultiLevelCache.LevelMetrics.Snapshot(String levelName, long hits, long misses, long promotions)
extends Record
Level metrics snapshot
级别指标快照
- Since:
- JDK 25, opencode-base-cache V2.0.5
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
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.doublehitRate()hitRate | hitRatelonghits()Returns the value of thehitsrecord component.Returns the value of thelevelNamerecord component.longmisses()Returns the value of themissesrecord component.longReturns the value of thepromotionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Snapshot
Creates an instance of aSnapshotrecord class.- Parameters:
levelName- the value for thelevelNamerecord componenthits- the value for thehitsrecord componentmisses- the value for themissesrecord componentpromotions- the value for thepromotionsrecord component
-
-
Method Details
-
hitRate
public double hitRate()hitRate | hitRate- 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. -
levelName
-
hits
-
misses
-
promotions
public long promotions()Returns the value of thepromotionsrecord component.- Returns:
- the value of the
promotionsrecord component
-