Record Class TcpServer.ServerStats
java.lang.Object
java.lang.Record
com.loomcache.server.network.TcpServer.ServerStats
- Enclosing class:
TcpServer
public static record TcpServer.ServerStats(int activeConnections, long totalConnections, long totalBytesReceived, long totalBytesSent, long totalRequests, double avgRequestLatencyMs, long uptimeMs)
extends Record
Server-wide statistics snapshot.
Includes connection counts, bytes transferred, requests, latency, and uptime.
-
Constructor Summary
ConstructorsConstructorDescriptionServerStats(int activeConnections, long totalConnections, long totalBytesReceived, long totalBytesSent, long totalRequests, double avgRequestLatencyMs, long uptimeMs) Creates an instance of aServerStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theactiveConnectionsrecord component.doubleReturns the value of theavgRequestLatencyMsrecord 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.longReturns the value of thetotalBytesReceivedrecord component.longReturns the value of thetotalBytesSentrecord component.longReturns the value of thetotalConnectionsrecord component.longReturns the value of thetotalRequestsrecord component.longuptimeMs()Returns the value of theuptimeMsrecord component.
-
Constructor Details
-
ServerStats
public ServerStats(int activeConnections, long totalConnections, long totalBytesReceived, long totalBytesSent, long totalRequests, double avgRequestLatencyMs, long uptimeMs) Creates an instance of aServerStatsrecord class.- Parameters:
activeConnections- the value for theactiveConnectionsrecord componenttotalConnections- the value for thetotalConnectionsrecord componenttotalBytesReceived- the value for thetotalBytesReceivedrecord componenttotalBytesSent- the value for thetotalBytesSentrecord componenttotalRequests- the value for thetotalRequestsrecord componentavgRequestLatencyMs- the value for theavgRequestLatencyMsrecord componentuptimeMs- the value for theuptimeMsrecord 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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
activeConnections
public int activeConnections()Returns the value of theactiveConnectionsrecord component.- Returns:
- the value of the
activeConnectionsrecord component
-
totalConnections
public long totalConnections()Returns the value of thetotalConnectionsrecord component.- Returns:
- the value of the
totalConnectionsrecord component
-
totalBytesReceived
public long totalBytesReceived()Returns the value of thetotalBytesReceivedrecord component.- Returns:
- the value of the
totalBytesReceivedrecord component
-
totalBytesSent
public long totalBytesSent()Returns the value of thetotalBytesSentrecord component.- Returns:
- the value of the
totalBytesSentrecord component
-
totalRequests
public long totalRequests()Returns the value of thetotalRequestsrecord component.- Returns:
- the value of the
totalRequestsrecord component
-
avgRequestLatencyMs
public double avgRequestLatencyMs()Returns the value of theavgRequestLatencyMsrecord component.- Returns:
- the value of the
avgRequestLatencyMsrecord component
-
uptimeMs
public long uptimeMs()Returns the value of theuptimeMsrecord component.- Returns:
- the value of the
uptimeMsrecord component
-