Record Class ConnectionPoolMetrics.MetricsSnapshot
java.lang.Object
java.lang.Record
com.loomcache.client.ConnectionPoolMetrics.MetricsSnapshot
- Enclosing class:
ConnectionPoolMetrics
public static record ConnectionPoolMetrics.MetricsSnapshot(long activeConnections, long idleConnections, long totalCreated, long totalDestroyed, long currentWaitCount, double averageWaitTime, long connectionErrors, long totalWaitCount, long totalWaitTimeMs, Instant capturedAt)
extends Record
Immutable snapshot of connection pool metrics at a point in time.
-
Constructor Summary
ConstructorsConstructorDescriptionMetricsSnapshot(long activeConnections, long idleConnections, long totalCreated, long totalDestroyed, long currentWaitCount, double averageWaitTime, long connectionErrors, long totalWaitCount, long totalWaitTimeMs, Instant capturedAt) Creates an instance of aMetricsSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the value of theactiveConnectionsrecord component.doubleReturns the value of theaverageWaitTimerecord component.Returns the value of thecapturedAtrecord component.longReturns the value of theconnectionErrorsrecord component.longReturns the value of thecurrentWaitCountrecord 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 theidleConnectionsrecord component.final StringtoString()Returns a string representation of this record class.longReturns the value of thetotalCreatedrecord component.longReturns the value of thetotalDestroyedrecord component.longReturns the value of thetotalWaitCountrecord component.longReturns the value of thetotalWaitTimeMsrecord component.
-
Constructor Details
-
MetricsSnapshot
public MetricsSnapshot(long activeConnections, long idleConnections, long totalCreated, long totalDestroyed, long currentWaitCount, double averageWaitTime, long connectionErrors, long totalWaitCount, long totalWaitTimeMs, Instant capturedAt) Creates an instance of aMetricsSnapshotrecord class.- Parameters:
activeConnections- the value for theactiveConnectionsrecord componentidleConnections- the value for theidleConnectionsrecord componenttotalCreated- the value for thetotalCreatedrecord componenttotalDestroyed- the value for thetotalDestroyedrecord componentcurrentWaitCount- the value for thecurrentWaitCountrecord componentaverageWaitTime- the value for theaverageWaitTimerecord componentconnectionErrors- the value for theconnectionErrorsrecord componenttotalWaitCount- the value for thetotalWaitCountrecord componenttotalWaitTimeMs- the value for thetotalWaitTimeMsrecord componentcapturedAt- the value for thecapturedAtrecord 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. -
activeConnections
public long activeConnections()Returns the value of theactiveConnectionsrecord component.- Returns:
- the value of the
activeConnectionsrecord component
-
idleConnections
public long idleConnections()Returns the value of theidleConnectionsrecord component.- Returns:
- the value of the
idleConnectionsrecord component
-
totalCreated
public long totalCreated()Returns the value of thetotalCreatedrecord component.- Returns:
- the value of the
totalCreatedrecord component
-
totalDestroyed
public long totalDestroyed()Returns the value of thetotalDestroyedrecord component.- Returns:
- the value of the
totalDestroyedrecord component
-
currentWaitCount
public long currentWaitCount()Returns the value of thecurrentWaitCountrecord component.- Returns:
- the value of the
currentWaitCountrecord component
-
averageWaitTime
public double averageWaitTime()Returns the value of theaverageWaitTimerecord component.- Returns:
- the value of the
averageWaitTimerecord component
-
connectionErrors
public long connectionErrors()Returns the value of theconnectionErrorsrecord component.- Returns:
- the value of the
connectionErrorsrecord component
-
totalWaitCount
public long totalWaitCount()Returns the value of thetotalWaitCountrecord component.- Returns:
- the value of the
totalWaitCountrecord component
-
totalWaitTimeMs
public long totalWaitTimeMs()Returns the value of thetotalWaitTimeMsrecord component.- Returns:
- the value of the
totalWaitTimeMsrecord component
-
capturedAt
Returns the value of thecapturedAtrecord component.- Returns:
- the value of the
capturedAtrecord component
-