Record Class WarmingResult

java.lang.Object
java.lang.Record
com.loomcache.server.cache.WarmingResult

public record WarmingResult(long totalLoaded, long totalFailed, long durationMs, Set<String> dataStructuresWarmed) extends Record
Final result of a cache warming operation. Contains summary metrics including total loaded, total failed, duration, and affected data structures.
  • Constructor Summary

    Constructors
    Constructor
    Description
    WarmingResult(long totalLoaded, long totalFailed, long durationMs, Set<String> dataStructuresWarmed)
    Creates an instance of a WarmingResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the dataStructuresWarmed record component.
    long
    Returns the value of the durationMs record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    double
    Calculate the failure rate as a percentage (0-100).
    double
    Calculate the success rate as a percentage (0-100).
    double
    Get the throughput in keys per second.
    final int
    Returns a hash code value for this object.
    boolean
    Check if warming was successful (all keys loaded, no failures).
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the totalFailed record component.
    long
    Returns the value of the totalLoaded record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WarmingResult

      public WarmingResult(long totalLoaded, long totalFailed, long durationMs, Set<String> dataStructuresWarmed)
      Creates an instance of a WarmingResult record class.
      Parameters:
      totalLoaded - the value for the totalLoaded record component
      totalFailed - the value for the totalFailed record component
      durationMs - the value for the durationMs record component
      dataStructuresWarmed - the value for the dataStructuresWarmed record component
  • Method Details

    • getSuccessRate

      public double getSuccessRate()
      Calculate the success rate as a percentage (0-100).
    • getFailureRate

      public double getFailureRate()
      Calculate the failure rate as a percentage (0-100).
    • getThroughputKeysPerSecond

      public double getThroughputKeysPerSecond()
      Get the throughput in keys per second.
    • isSuccessful

      public boolean isSuccessful()
      Check if warming was successful (all keys loaded, no failures).
    • 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.
    • totalLoaded

      public long totalLoaded()
      Returns the value of the totalLoaded record component.
      Returns:
      the value of the totalLoaded record component
    • totalFailed

      public long totalFailed()
      Returns the value of the totalFailed record component.
      Returns:
      the value of the totalFailed record component
    • durationMs

      public long durationMs()
      Returns the value of the durationMs record component.
      Returns:
      the value of the durationMs record component
    • dataStructuresWarmed

      public Set<String> dataStructuresWarmed()
      Returns the value of the dataStructuresWarmed record component.
      Returns:
      the value of the dataStructuresWarmed record component