Record Class WarmingProgress
java.lang.Object
java.lang.Record
com.loomcache.server.cache.WarmingProgress
public record WarmingProgress(long totalKeys, long loadedKeys, long failedKeys, long elapsedMs, long estimatedRemainingMs)
extends Record
Real-time progress metrics during a cache warming operation.
Tracks total keys, loaded keys, failed keys, elapsed time, and estimated remaining time.
-
Constructor Summary
ConstructorsConstructorDescriptionWarmingProgress(long totalKeys, long loadedKeys, long failedKeys, long elapsedMs, long estimatedRemainingMs) Creates an instance of aWarmingProgressrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theelapsedMsrecord component.final booleanIndicates whether some other object is "equal to" this one.longReturns the value of theestimatedRemainingMsrecord component.longReturns the value of thefailedKeysrecord component.doubleGet the throughput in keys per second.doubleCalculate the percentage of keys loaded (0-100).final inthashCode()Returns a hash code value for this object.booleanCheck if warming is complete.longReturns the value of theloadedKeysrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalKeysrecord component.
-
Constructor Details
-
WarmingProgress
public WarmingProgress(long totalKeys, long loadedKeys, long failedKeys, long elapsedMs, long estimatedRemainingMs) Creates an instance of aWarmingProgressrecord class.- Parameters:
totalKeys- the value for thetotalKeysrecord componentloadedKeys- the value for theloadedKeysrecord componentfailedKeys- the value for thefailedKeysrecord componentelapsedMs- the value for theelapsedMsrecord componentestimatedRemainingMs- the value for theestimatedRemainingMsrecord component
-
-
Method Details
-
getProgressPercentage
public double getProgressPercentage()Calculate the percentage of keys loaded (0-100). -
getKeysPerSecond
public double getKeysPerSecond()Get the throughput in keys per second. -
isComplete
public boolean isComplete()Check if warming is complete. -
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. -
totalKeys
public long totalKeys()Returns the value of thetotalKeysrecord component.- Returns:
- the value of the
totalKeysrecord component
-
loadedKeys
public long loadedKeys()Returns the value of theloadedKeysrecord component.- Returns:
- the value of the
loadedKeysrecord component
-
failedKeys
public long failedKeys()Returns the value of thefailedKeysrecord component.- Returns:
- the value of the
failedKeysrecord component
-
elapsedMs
public long elapsedMs()Returns the value of theelapsedMsrecord component.- Returns:
- the value of the
elapsedMsrecord component
-
estimatedRemainingMs
public long estimatedRemainingMs()Returns the value of theestimatedRemainingMsrecord component.- Returns:
- the value of the
estimatedRemainingMsrecord component
-