Record Class ConnectionHealthMonitor.ConnectionHealth
java.lang.Object
java.lang.Record
com.loomcache.server.network.ConnectionHealthMonitor.ConnectionHealth
- Record Components:
connectionId- unique identifier for the connectionstatus- current health statuslatencyMs- current latency in millisecondserrorRate- current error rate (0.0 to 1.0)lastActivityTime- timestamp of last activitycheckCount- number of health checks performed
- Enclosing class:
ConnectionHealthMonitor
public static record ConnectionHealthMonitor.ConnectionHealth(String connectionId, ConnectionHealthMonitor.HealthStatus status, long latencyMs, double errorRate, Instant lastActivityTime, int checkCount)
extends Record
Immutable record containing health information for a single connection.
- Version:
- 1.0
- Author:
- ConnectionHealthMonitor Implementation
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionHealth(String connectionId, ConnectionHealthMonitor.HealthStatus status, long latencyMs, double errorRate, Instant lastActivityTime, int checkCount) Creates an instance of aConnectionHealthrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thecheckCountrecord component.Returns the value of theconnectionIdrecord component.final booleanIndicates whether some other object is "equal to" this one.doubleReturns the value of theerrorRaterecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thelastActivityTimerecord component.longReturns the value of thelatencyMsrecord component.status()Returns the value of thestatusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConnectionHealth
public ConnectionHealth(String connectionId, ConnectionHealthMonitor.HealthStatus status, long latencyMs, double errorRate, Instant lastActivityTime, int checkCount) Creates an instance of aConnectionHealthrecord class.- Parameters:
connectionId- the value for theconnectionIdrecord componentstatus- the value for thestatusrecord componentlatencyMs- the value for thelatencyMsrecord componenterrorRate- the value for theerrorRaterecord componentlastActivityTime- the value for thelastActivityTimerecord componentcheckCount- the value for thecheckCountrecord 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. -
connectionId
Returns the value of theconnectionIdrecord component.- Returns:
- the value of the
connectionIdrecord component
-
status
-
latencyMs
-
errorRate
-
lastActivityTime
Returns the value of thelastActivityTimerecord component.- Returns:
- the value of the
lastActivityTimerecord component
-
checkCount
public int checkCount()Returns the value of thecheckCountrecord component.- Returns:
- the value of the
checkCountrecord component
-