Record Class WriteBehindCache.WriteBehindStats

java.lang.Object
java.lang.Record
cloud.opencode.base.cache.WriteBehindCache.WriteBehindStats
Record Components:
totalWrites - total number of writes | 总写入数
batchedWrites - number of batched writes | 批量写入数
failedWrites - number of failed writes | 失败写入数
coalescedWrites - number of coalesced writes | 合并写入数
pendingWrites - number of pending writes | 待处理写入数
Enclosing class:
WriteBehindCache<K,V>

public static record WriteBehindCache.WriteBehindStats(long totalWrites, long batchedWrites, long failedWrites, long coalescedWrites, long pendingWrites) extends Record
Write-behind statistics 写后统计信息
Since:
JDK 25, opencode-base-cache V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • WriteBehindStats

      public WriteBehindStats(long totalWrites, long batchedWrites, long failedWrites, long coalescedWrites, long pendingWrites)
      Creates an instance of a WriteBehindStats record class.
      Parameters:
      totalWrites - the value for the totalWrites record component
      batchedWrites - the value for the batchedWrites record component
      failedWrites - the value for the failedWrites record component
      coalescedWrites - the value for the coalescedWrites record component
      pendingWrites - the value for the pendingWrites record component
  • Method Details

    • coalescingRatio

      public double coalescingRatio()
      Get coalescing ratio (how many writes were merged) 获取合并比率(多少写入被合并)
      Returns:
      coalescing ratio | 合并比率
    • successRatio

      public double successRatio()
      Get success ratio 获取成功比率
      Returns:
      success ratio | 成功比率
    • 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 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.
    • totalWrites

      public long totalWrites()
      Returns the value of the totalWrites record component.
      Returns:
      the value of the totalWrites record component
    • batchedWrites

      public long batchedWrites()
      Returns the value of the batchedWrites record component.
      Returns:
      the value of the batchedWrites record component
    • failedWrites

      public long failedWrites()
      Returns the value of the failedWrites record component.
      Returns:
      the value of the failedWrites record component
    • coalescedWrites

      public long coalescedWrites()
      Returns the value of the coalescedWrites record component.
      Returns:
      the value of the coalescedWrites record component
    • pendingWrites

      public long pendingWrites()
      Returns the value of the pendingWrites record component.
      Returns:
      the value of the pendingWrites record component