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 Summary
ConstructorsConstructorDescriptionWriteBehindStats(long totalWrites, long batchedWrites, long failedWrites, long coalescedWrites, long pendingWrites) Creates an instance of aWriteBehindStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of thebatchedWritesrecord component.longReturns the value of thecoalescedWritesrecord component.doubleGet coalescing ratio (how many writes were merged) 获取合并比率(多少写入被合并)final booleanIndicates whether some other object is "equal to" this one.longReturns the value of thefailedWritesrecord component.final inthashCode()Returns a hash code value for this object.longReturns the value of thependingWritesrecord component.doubleGet success ratio 获取成功比率final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalWritesrecord component.
-
Constructor Details
-
WriteBehindStats
public WriteBehindStats(long totalWrites, long batchedWrites, long failedWrites, long coalescedWrites, long pendingWrites) Creates an instance of aWriteBehindStatsrecord class.- Parameters:
totalWrites- the value for thetotalWritesrecord componentbatchedWrites- the value for thebatchedWritesrecord componentfailedWrites- the value for thefailedWritesrecord componentcoalescedWrites- the value for thecoalescedWritesrecord componentpendingWrites- the value for thependingWritesrecord 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
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
totalWrites
public long totalWrites()Returns the value of thetotalWritesrecord component.- Returns:
- the value of the
totalWritesrecord component
-
batchedWrites
public long batchedWrites()Returns the value of thebatchedWritesrecord component.- Returns:
- the value of the
batchedWritesrecord component
-
failedWrites
public long failedWrites()Returns the value of thefailedWritesrecord component.- Returns:
- the value of the
failedWritesrecord component
-
coalescedWrites
public long coalescedWrites()Returns the value of thecoalescedWritesrecord component.- Returns:
- the value of the
coalescedWritesrecord component
-
pendingWrites
public long pendingWrites()Returns the value of thependingWritesrecord component.- Returns:
- the value of the
pendingWritesrecord component
-