Record Class ReplicationStats

java.lang.Object
java.lang.Record
com.loomcache.server.consensus.ReplicationStats
Record Components:
totalAppendEntries - Total number of AppendEntries RPCs sent
totalSuccessful - Number of successful AppendEntries responses
totalRejected - Number of rejected/failed AppendEntries responses
avgReplicationLatencyMs - Average round-trip time for successful AppendEntries (ms)
pendingEntries - Current number of entries awaiting replication

public record ReplicationStats(long totalAppendEntries, long totalSuccessful, long totalRejected, double avgReplicationLatencyMs, long pendingEntries) extends Record
Statistics snapshot of replication activity.

Captures metrics related to log replication including RPC counts, success/failure rates, latency, and pending entries.

  • Constructor Details

    • ReplicationStats

      public ReplicationStats(long totalAppendEntries, long totalSuccessful, long totalRejected, double avgReplicationLatencyMs, long pendingEntries)
      Creates an instance of a ReplicationStats record class.
      Parameters:
      totalAppendEntries - the value for the totalAppendEntries record component
      totalSuccessful - the value for the totalSuccessful record component
      totalRejected - the value for the totalRejected record component
      avgReplicationLatencyMs - the value for the avgReplicationLatencyMs record component
      pendingEntries - the value for the pendingEntries record component
  • Method Details

    • 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.
    • totalAppendEntries

      public long totalAppendEntries()
      Returns the value of the totalAppendEntries record component.
      Returns:
      the value of the totalAppendEntries record component
    • totalSuccessful

      public long totalSuccessful()
      Returns the value of the totalSuccessful record component.
      Returns:
      the value of the totalSuccessful record component
    • totalRejected

      public long totalRejected()
      Returns the value of the totalRejected record component.
      Returns:
      the value of the totalRejected record component
    • avgReplicationLatencyMs

      public double avgReplicationLatencyMs()
      Returns the value of the avgReplicationLatencyMs record component.
      Returns:
      the value of the avgReplicationLatencyMs record component
    • pendingEntries

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