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 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 a AccessPatternReport record class.
      Parameters:
      analysisTime - the value for the analysisTime record component
      totalKeys - the value for the totalKeys record component
      totalAccesses - the value for the totalAccesses record component
      averageAccessPerKey - the value for the averageAccessPerKey record component
      hotKeyCount - the value for the hotKeyCount record component
      coldKeyCount - the value for the coldKeyCount record component
      hotKeys - the value for the hotKeys record component
      coldKeys - the value for the coldKeys record component
      topK - the value for the topK record component
      bottomK - the value for the bottomK record component
      accessDistribution - the value for the accessDistribution record 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

      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.
    • analysisTime

      public Instant analysisTime()
      Returns the value of the analysisTime record component.
      Returns:
      the value of the analysisTime record component
    • totalKeys

      public long totalKeys()
      Returns the value of the totalKeys record component.
      Returns:
      the value of the totalKeys record component
    • totalAccesses

      public long totalAccesses()
      Returns the value of the totalAccesses record component.
      Returns:
      the value of the totalAccesses record component
    • averageAccessPerKey

      public double averageAccessPerKey()
      Returns the value of the averageAccessPerKey record component.
      Returns:
      the value of the averageAccessPerKey record component
    • hotKeyCount

      public int hotKeyCount()
      Returns the value of the hotKeyCount record component.
      Returns:
      the value of the hotKeyCount record component
    • coldKeyCount

      public int coldKeyCount()
      Returns the value of the coldKeyCount record component.
      Returns:
      the value of the coldKeyCount record component
    • hotKeys

      public Set<K> hotKeys()
      Returns the value of the hotKeys record component.
      Returns:
      the value of the hotKeys record component
    • coldKeys

      public Set<K> coldKeys()
      Returns the value of the coldKeys record component.
      Returns:
      the value of the coldKeys record component
    • topK

      Returns the value of the topK record component.
      Returns:
      the value of the topK record component
    • bottomK

      Returns the value of the bottomK record component.
      Returns:
      the value of the bottomK record component
    • accessDistribution

      public long[] accessDistribution()
      Returns the value of the accessDistribution record component.
      Returns:
      the value of the accessDistribution record component