Record Class TcpServer.ServerHealthStatus
java.lang.Object
java.lang.Record
com.loomcache.server.network.TcpServer.ServerHealthStatus
- Enclosing class:
TcpServer
public static record TcpServer.ServerHealthStatus(long uptimeMs, int totalConnections, int activeConnections, int droppedConnections, TcpServer.BandwidthStats bandwidth)
extends Record
Server health status snapshot.
Includes uptime, connection counts, and bandwidth statistics.
-
Constructor Summary
ConstructorsConstructorDescriptionServerHealthStatus(long uptimeMs, int totalConnections, int activeConnections, int droppedConnections, TcpServer.BandwidthStats bandwidth) Creates an instance of aServerHealthStatusrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theactiveConnectionsrecord component.Returns the value of thebandwidthrecord component.intReturns the value of thedroppedConnectionsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.intReturns the value of thetotalConnectionsrecord component.longuptimeMs()Returns the value of theuptimeMsrecord component.
-
Constructor Details
-
ServerHealthStatus
public ServerHealthStatus(long uptimeMs, int totalConnections, int activeConnections, int droppedConnections, TcpServer.BandwidthStats bandwidth) Creates an instance of aServerHealthStatusrecord class.- Parameters:
uptimeMs- the value for theuptimeMsrecord componenttotalConnections- the value for thetotalConnectionsrecord componentactiveConnections- the value for theactiveConnectionsrecord componentdroppedConnections- the value for thedroppedConnectionsrecord componentbandwidth- the value for thebandwidthrecord 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. -
uptimeMs
public long uptimeMs()Returns the value of theuptimeMsrecord component.- Returns:
- the value of the
uptimeMsrecord component
-
totalConnections
public int totalConnections()Returns the value of thetotalConnectionsrecord component.- Returns:
- the value of the
totalConnectionsrecord component
-
activeConnections
public int activeConnections()Returns the value of theactiveConnectionsrecord component.- Returns:
- the value of the
activeConnectionsrecord component
-
droppedConnections
public int droppedConnections()Returns the value of thedroppedConnectionsrecord component.- Returns:
- the value of the
droppedConnectionsrecord component
-
bandwidth
Returns the value of thebandwidthrecord component.- Returns:
- the value of the
bandwidthrecord component
-