Record Class ClusterHealthMonitor.NodeHealth
java.lang.Object
java.lang.Record
com.loomcache.server.cluster.ClusterHealthMonitor.NodeHealth
- Enclosing class:
ClusterHealthMonitor
public static record ClusterHealthMonitor.NodeHealth(String nodeId, ClusterHealthMonitor.HealthStatus status, long uptimeSeconds, long memoryUsedBytes, long memoryMaxBytes, double cpuLoadPercent, long totalKeys, RaftState raftState, long lastHeartbeatAgo)
extends Record
Health information for a single node.
-
Constructor Summary
ConstructorsConstructorDescriptionNodeHealth(String nodeId, ClusterHealthMonitor.HealthStatus status, long uptimeSeconds, long memoryUsedBytes, long memoryMaxBytes, double cpuLoadPercent, long totalKeys, RaftState raftState, long lastHeartbeatAgo) Creates an instance of aNodeHealthrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thecpuLoadPercentrecord component.final booleanIndicates whether some other object is "equal to" this one.Get uptime as a duration.final inthashCode()Returns a hash code value for this object.longReturns the value of thelastHeartbeatAgorecord component.longReturns the value of thememoryMaxBytesrecord component.doubleGet memory usage as a percentage.longReturns the value of thememoryUsedBytesrecord component.nodeId()Returns the value of thenodeIdrecord component.Returns the value of theraftStaterecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalKeysrecord component.longReturns the value of theuptimeSecondsrecord component.
-
Constructor Details
-
NodeHealth
public NodeHealth(String nodeId, ClusterHealthMonitor.HealthStatus status, long uptimeSeconds, long memoryUsedBytes, long memoryMaxBytes, double cpuLoadPercent, long totalKeys, RaftState raftState, long lastHeartbeatAgo) Creates an instance of aNodeHealthrecord class.- Parameters:
nodeId- the value for thenodeIdrecord componentstatus- the value for thestatusrecord componentuptimeSeconds- the value for theuptimeSecondsrecord componentmemoryUsedBytes- the value for thememoryUsedBytesrecord componentmemoryMaxBytes- the value for thememoryMaxBytesrecord componentcpuLoadPercent- the value for thecpuLoadPercentrecord componenttotalKeys- the value for thetotalKeysrecord componentraftState- the value for theraftStaterecord componentlastHeartbeatAgo- the value for thelastHeartbeatAgorecord component
-
-
Method Details
-
memoryUsagePercent
public double memoryUsagePercent()Get memory usage as a percentage. -
getUptimeDuration
Get uptime as a duration. -
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. -
nodeId
Returns the value of thenodeIdrecord component.- Returns:
- the value of the
nodeIdrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
uptimeSeconds
public long uptimeSeconds()Returns the value of theuptimeSecondsrecord component.- Returns:
- the value of the
uptimeSecondsrecord component
-
memoryUsedBytes
public long memoryUsedBytes()Returns the value of thememoryUsedBytesrecord component.- Returns:
- the value of the
memoryUsedBytesrecord component
-
memoryMaxBytes
public long memoryMaxBytes()Returns the value of thememoryMaxBytesrecord component.- Returns:
- the value of the
memoryMaxBytesrecord component
-
cpuLoadPercent
public double cpuLoadPercent()Returns the value of thecpuLoadPercentrecord component.- Returns:
- the value of the
cpuLoadPercentrecord component
-
totalKeys
public long totalKeys()Returns the value of thetotalKeysrecord component.- Returns:
- the value of the
totalKeysrecord component
-
raftState
Returns the value of theraftStaterecord component.- Returns:
- the value of the
raftStaterecord component
-
lastHeartbeatAgo
public long lastHeartbeatAgo()Returns the value of thelastHeartbeatAgorecord component.- Returns:
- the value of the
lastHeartbeatAgorecord component
-