Record Class ReplicationStats
java.lang.Object
java.lang.Record
com.loomcache.server.consensus.ReplicationStats
- Record Components:
totalAppendEntries- Total number of AppendEntries RPCs senttotalSuccessful- Number of successful AppendEntries responsestotalRejected- Number of rejected/failed AppendEntries responsesavgReplicationLatencyMs- 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 Summary
ConstructorsConstructorDescriptionReplicationStats(long totalAppendEntries, long totalSuccessful, long totalRejected, double avgReplicationLatencyMs, long pendingEntries) Creates an instance of aReplicationStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theavgReplicationLatencyMsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of thependingEntriesrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalAppendEntriesrecord component.longReturns the value of thetotalRejectedrecord component.longReturns the value of thetotalSuccessfulrecord component.
-
Constructor Details
-
ReplicationStats
public ReplicationStats(long totalAppendEntries, long totalSuccessful, long totalRejected, double avgReplicationLatencyMs, long pendingEntries) Creates an instance of aReplicationStatsrecord class.- Parameters:
totalAppendEntries- the value for thetotalAppendEntriesrecord componenttotalSuccessful- the value for thetotalSuccessfulrecord componenttotalRejected- the value for thetotalRejectedrecord componentavgReplicationLatencyMs- the value for theavgReplicationLatencyMsrecord componentpendingEntries- the value for thependingEntriesrecord component
-
-
Method Details
-
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. -
totalAppendEntries
public long totalAppendEntries()Returns the value of thetotalAppendEntriesrecord component.- Returns:
- the value of the
totalAppendEntriesrecord component
-
totalSuccessful
public long totalSuccessful()Returns the value of thetotalSuccessfulrecord component.- Returns:
- the value of the
totalSuccessfulrecord component
-
totalRejected
public long totalRejected()Returns the value of thetotalRejectedrecord component.- Returns:
- the value of the
totalRejectedrecord component
-
avgReplicationLatencyMs
public double avgReplicationLatencyMs()Returns the value of theavgReplicationLatencyMsrecord component.- Returns:
- the value of the
avgReplicationLatencyMsrecord component
-
pendingEntries
public long pendingEntries()Returns the value of thependingEntriesrecord component.- Returns:
- the value of the
pendingEntriesrecord component
-