Record Class PoolMetrics

java.lang.Object
java.lang.Record
org.microproxy.PoolMetrics
Record Components:
totalConnections - pooled connections alive, leased or idle
activeConnections - connections currently leased to a request or session
idleConnections - connections waiting in the pool
borrowCount - leases granted (reused or newly created)
returnCount - connections returned to the pool
evictionCount - idle connections closed for idle timeout or to make room
validationFailureCount - idle connections found closed when about to be reused

public record PoolMetrics(int totalConnections, int activeConnections, int idleConnections, long borrowCount, long returnCount, long evictionCount, long validationFailureCount) extends Record
A snapshot of the shared server connection pool.
  • Constructor Details

    • PoolMetrics

      public PoolMetrics(int totalConnections, int activeConnections, int idleConnections, long borrowCount, long returnCount, long evictionCount, long validationFailureCount)
      Creates an instance of a PoolMetrics record class.
      Parameters:
      totalConnections - the value for the totalConnections record component
      activeConnections - the value for the activeConnections record component
      idleConnections - the value for the idleConnections record component
      borrowCount - the value for the borrowCount record component
      returnCount - the value for the returnCount record component
      evictionCount - the value for the evictionCount record component
      validationFailureCount - the value for the validationFailureCount record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • totalConnections

      public int totalConnections()
      Returns the value of the totalConnections record component.
      Returns:
      the value of the totalConnections record component
    • activeConnections

      public int activeConnections()
      Returns the value of the activeConnections record component.
      Returns:
      the value of the activeConnections record component
    • idleConnections

      public int idleConnections()
      Returns the value of the idleConnections record component.
      Returns:
      the value of the idleConnections record component
    • borrowCount

      public long borrowCount()
      Returns the value of the borrowCount record component.
      Returns:
      the value of the borrowCount record component
    • returnCount

      public long returnCount()
      Returns the value of the returnCount record component.
      Returns:
      the value of the returnCount record component
    • evictionCount

      public long evictionCount()
      Returns the value of the evictionCount record component.
      Returns:
      the value of the evictionCount record component
    • validationFailureCount

      public long validationFailureCount()
      Returns the value of the validationFailureCount record component.
      Returns:
      the value of the validationFailureCount record component