Record Class LayeredCache.LayeredCacheStats

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.LayeredCache.LayeredCacheStats
Record Components:
l1Stats - L1 statistics | L1统计
l2Stats - L2 statistics | L2统计
Enclosing class:
LayeredCache<K,V>

public static record LayeredCache.LayeredCacheStats(CacheStats l1Stats, CacheStats l2Stats) extends Record
Layered cache statistics 分层缓存统计
Since:
JDK 25, opencode-base-cache V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • LayeredCacheStats

      public LayeredCacheStats(CacheStats l1Stats, CacheStats l2Stats)
      Creates an instance of a LayeredCacheStats record class.
      Parameters:
      l1Stats - the value for the l1Stats record component
      l2Stats - the value for the l2Stats record component
  • Method Details

    • l1HitRate

      public double l1HitRate()
      Gets L1 hit rate 获取L1命中率
      Returns:
      L1 hit rate | L1命中率
    • l2HitRate

      public double l2HitRate()
      Gets L2 hit rate 获取L2命中率
      Returns:
      L2 hit rate | L2命中率
    • overallHitRate

      public double overallHitRate()
      Gets overall hit rate 获取总体命中率
      Returns:
      overall hit rate | 总体命中率
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • l1Stats

      public CacheStats l1Stats()
      Returns the value of the l1Stats record component.
      Returns:
      the value of the l1Stats record component
    • l2Stats

      public CacheStats l2Stats()
      Returns the value of the l2Stats record component.
      Returns:
      the value of the l2Stats record component