Record Class AccessPatternAnalyzer.AccessPatternReport<K>
java.lang.Object
java.lang.Record
cloud.opencode.base.cache.analysis.AccessPatternAnalyzer.AccessPatternReport<K>
- Type Parameters:
K- key type | 键类型- Record Components:
analysisTime- the time of analysis | 分析时间totalKeys- the total number of keys | 总键数totalAccesses- the total number of accesses | 总访问数averageAccessPerKey- the average accesses per key | 每个键的平均访问数hotKeyCount- the number of hot keys | 热键数coldKeyCount- the number of cold keys | 冷键数hotKeys- the set of hot keys | 热键集合coldKeys- the set of cold keys | 冷键集合topK- the top-K most accessed keys | 访问最多的前K个键bottomK- the bottom-K least accessed keys | 访问最少的后K个键accessDistribution- the access count distribution | 访问计数分布
- Enclosing class:
AccessPatternAnalyzer<K>
public static record AccessPatternAnalyzer.AccessPatternReport<K>(Instant analysisTime, long totalKeys, long totalAccesses, double averageAccessPerKey, int hotKeyCount, int coldKeyCount, Set<K> hotKeys, Set<K> coldKeys, List<AccessPatternAnalyzer.KeyAccessCount<K>> topK, List<AccessPatternAnalyzer.KeyAccessCount<K>> bottomK, long[] accessDistribution)
extends Record
Access pattern analysis report
访问模式分析报告
- Since:
- JDK 25, opencode-base-cache V2.0.5
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
ConstructorsConstructorDescriptionAccessPatternReport(Instant analysisTime, long totalKeys, long totalAccesses, double averageAccessPerKey, int hotKeyCount, int coldKeyCount, Set<K> hotKeys, Set<K> coldKeys, List<AccessPatternAnalyzer.KeyAccessCount<K>> topK, List<AccessPatternAnalyzer.KeyAccessCount<K>> bottomK, long[] accessDistribution) Creates an instance of aAccessPatternReportrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlong[]Returns the value of theaccessDistributionrecord component.Returns the value of theanalysisTimerecord component.doubleReturns the value of theaverageAccessPerKeyrecord component.bottomK()Returns the value of thebottomKrecord component.intReturns the value of thecoldKeyCountrecord component.doubleGet cold key percentage 获取冷数据键百分比coldKeys()Returns the value of thecoldKeysrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thehotKeyCountrecord component.doubleGet hot key percentage 获取热点键百分比hotKeys()Returns the value of thehotKeysrecord component.booleanisSkewed()Check if access pattern is skewed (top 20% keys have 80% access) 检查访问模式是否倾斜(前 20% 的键占 80% 的访问)toMap()Convert to map for JSON serialization 转换为 Map 用于 JSON 序列化topK()Returns the value of thetopKrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAccessesrecord component.longReturns the value of thetotalKeysrecord component.
-
Constructor Details
-
AccessPatternReport
public AccessPatternReport(Instant analysisTime, long totalKeys, long totalAccesses, double averageAccessPerKey, int hotKeyCount, int coldKeyCount, Set<K> hotKeys, Set<K> coldKeys, List<AccessPatternAnalyzer.KeyAccessCount<K>> topK, List<AccessPatternAnalyzer.KeyAccessCount<K>> bottomK, long[] accessDistribution) Creates an instance of aAccessPatternReportrecord class.- Parameters:
analysisTime- the value for theanalysisTimerecord componenttotalKeys- the value for thetotalKeysrecord componenttotalAccesses- the value for thetotalAccessesrecord componentaverageAccessPerKey- the value for theaverageAccessPerKeyrecord componenthotKeyCount- the value for thehotKeyCountrecord componentcoldKeyCount- the value for thecoldKeyCountrecord componenthotKeys- the value for thehotKeysrecord componentcoldKeys- the value for thecoldKeysrecord componenttopK- the value for thetopKrecord componentbottomK- the value for thebottomKrecord componentaccessDistribution- the value for theaccessDistributionrecord component
-
-
Method Details
-
hotKeyPercentage
public double hotKeyPercentage()Get hot key percentage 获取热点键百分比- Returns:
- hot key percentage | 热点键百分比
-
coldKeyPercentage
public double coldKeyPercentage()Get cold key percentage 获取冷数据键百分比- Returns:
- cold key percentage | 冷数据键百分比
-
isSkewed
public boolean isSkewed()Check if access pattern is skewed (top 20% keys have 80% access) 检查访问模式是否倾斜(前 20% 的键占 80% 的访问)- Returns:
- true if skewed | 如果倾斜返回 true
-
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. -
analysisTime
Returns the value of theanalysisTimerecord component.- Returns:
- the value of the
analysisTimerecord component
-
totalKeys
-
totalAccesses
public long totalAccesses()Returns the value of thetotalAccessesrecord component.- Returns:
- the value of the
totalAccessesrecord component
-
averageAccessPerKey
public double averageAccessPerKey()Returns the value of theaverageAccessPerKeyrecord component.- Returns:
- the value of the
averageAccessPerKeyrecord component
-
hotKeyCount
public int hotKeyCount()Returns the value of thehotKeyCountrecord component.- Returns:
- the value of the
hotKeyCountrecord component
-
coldKeyCount
public int coldKeyCount()Returns the value of thecoldKeyCountrecord component.- Returns:
- the value of the
coldKeyCountrecord component
-
hotKeys
-
coldKeys
-
topK
-
bottomK
-
accessDistribution
public long[] accessDistribution()Returns the value of theaccessDistributionrecord component.- Returns:
- the value of the
accessDistributionrecord component
-