Record Class RaftMetrics.MetricsSnapshot
java.lang.Object
java.lang.Record
com.loomcache.server.consensus.RaftMetrics.MetricsSnapshot
- Enclosing class:
RaftMetrics
public static record RaftMetrics.MetricsSnapshot(long electionCount, long appendEntriesCount, double appendEntriesAvgLatency, long commitCount, double commitAvgLatency, long logSize, long uncommittedEntries, long termChanges, long snapshotCount, Instant capturedAt)
extends Record
Immutable snapshot of Raft metrics at a point in time.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionMetricsSnapshot(long electionCount, long appendEntriesCount, double appendEntriesAvgLatency, long commitCount, double commitAvgLatency, long logSize, long uncommittedEntries, long termChanges, long snapshotCount, Instant capturedAt) Creates an instance of aMetricsSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of theappendEntriesAvgLatencyrecord component.longReturns the value of theappendEntriesCountrecord component.Returns the value of thecapturedAtrecord component.doubleReturns the value of thecommitAvgLatencyrecord component.longReturns the value of thecommitCountrecord component.longReturns the value of theelectionCountrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longlogSize()Returns the value of thelogSizerecord component.longReturns the value of thesnapshotCountrecord component.longReturns the value of thetermChangesrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of theuncommittedEntriesrecord component.
-
Constructor Details
-
MetricsSnapshot
public MetricsSnapshot(long electionCount, long appendEntriesCount, double appendEntriesAvgLatency, long commitCount, double commitAvgLatency, long logSize, long uncommittedEntries, long termChanges, long snapshotCount, Instant capturedAt) Creates an instance of aMetricsSnapshotrecord class.- Parameters:
electionCount- the value for theelectionCountrecord componentappendEntriesCount- the value for theappendEntriesCountrecord componentappendEntriesAvgLatency- the value for theappendEntriesAvgLatencyrecord componentcommitCount- the value for thecommitCountrecord componentcommitAvgLatency- the value for thecommitAvgLatencyrecord componentlogSize- the value for thelogSizerecord componentuncommittedEntries- the value for theuncommittedEntriesrecord componenttermChanges- the value for thetermChangesrecord componentsnapshotCount- the value for thesnapshotCountrecord componentcapturedAt- the value for thecapturedAtrecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
electionCount
public long electionCount()Returns the value of theelectionCountrecord component.- Returns:
- the value of the
electionCountrecord component
-
appendEntriesCount
public long appendEntriesCount()Returns the value of theappendEntriesCountrecord component.- Returns:
- the value of the
appendEntriesCountrecord component
-
appendEntriesAvgLatency
public double appendEntriesAvgLatency()Returns the value of theappendEntriesAvgLatencyrecord component.- Returns:
- the value of the
appendEntriesAvgLatencyrecord component
-
commitCount
public long commitCount()Returns the value of thecommitCountrecord component.- Returns:
- the value of the
commitCountrecord component
-
commitAvgLatency
public double commitAvgLatency()Returns the value of thecommitAvgLatencyrecord component.- Returns:
- the value of the
commitAvgLatencyrecord component
-
logSize
public long logSize()Returns the value of thelogSizerecord component.- Returns:
- the value of the
logSizerecord component
-
uncommittedEntries
public long uncommittedEntries()Returns the value of theuncommittedEntriesrecord component.- Returns:
- the value of the
uncommittedEntriesrecord component
-
termChanges
public long termChanges()Returns the value of thetermChangesrecord component.- Returns:
- the value of the
termChangesrecord component
-
snapshotCount
public long snapshotCount()Returns the value of thesnapshotCountrecord component.- Returns:
- the value of the
snapshotCountrecord component
-
capturedAt
Returns the value of thecapturedAtrecord component.- Returns:
- the value of the
capturedAtrecord component
-