Record Class ClusterHealthMonitor.HealthSnapshot
java.lang.Object
java.lang.Record
com.loomcache.server.cluster.ClusterHealthMonitor.HealthSnapshot
- Enclosing class:
ClusterHealthMonitor
public static record ClusterHealthMonitor.HealthSnapshot(Instant timestamp, String nodeId, ClusterHealthMonitor.HealthStatus status, double memoryUsagePercent, double cpuLoadPercent, long lastHeartbeatAgoMs)
extends Record
Health snapshot for historical tracking.
-
Constructor Summary
ConstructorsConstructorDescriptionHealthSnapshot(Instant timestamp, String nodeId, ClusterHealthMonitor.HealthStatus status, double memoryUsagePercent, double cpuLoadPercent, long lastHeartbeatAgoMs) Creates an instance of aHealthSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the value of thecpuLoadPercentrecord 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 thelastHeartbeatAgoMsrecord component.doubleReturns the value of thememoryUsagePercentrecord component.nodeId()Returns the value of thenodeIdrecord component.status()Returns the value of thestatusrecord component.Returns the value of thetimestamprecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
HealthSnapshot
public HealthSnapshot(Instant timestamp, String nodeId, ClusterHealthMonitor.HealthStatus status, double memoryUsagePercent, double cpuLoadPercent, long lastHeartbeatAgoMs) Creates an instance of aHealthSnapshotrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentnodeId- the value for thenodeIdrecord componentstatus- the value for thestatusrecord componentmemoryUsagePercent- the value for thememoryUsagePercentrecord componentcpuLoadPercent- the value for thecpuLoadPercentrecord componentlastHeartbeatAgoMs- the value for thelastHeartbeatAgoMsrecord 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. -
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
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
-
memoryUsagePercent
public double memoryUsagePercent()Returns the value of thememoryUsagePercentrecord component.- Returns:
- the value of the
memoryUsagePercentrecord component
-
cpuLoadPercent
public double cpuLoadPercent()Returns the value of thecpuLoadPercentrecord component.- Returns:
- the value of the
cpuLoadPercentrecord component
-
lastHeartbeatAgoMs
public long lastHeartbeatAgoMs()Returns the value of thelastHeartbeatAgoMsrecord component.- Returns:
- the value of the
lastHeartbeatAgoMsrecord component
-