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

    Constructors
    Constructor
    Description
    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 a MetricsSnapshot record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Returns the value of the activeConnections record component.
    double
    Returns the value of the averageWaitTime record component.
    Returns the value of the capturedAt record component.
    long
    Returns the value of the connectionErrors record component.
    long
    Returns the value of the currentWaitCount record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    long
    Returns the value of the idleConnections record component.
    final String
    Returns a string representation of this record class.
    long
    Returns the value of the totalCreated record component.
    long
    Returns the value of the totalDestroyed record component.
    long
    Returns the value of the totalWaitCount record component.
    long
    Returns the value of the totalWaitTimeMs record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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 a MetricsSnapshot record class.
      Parameters:
      activeConnections - the value for the activeConnections record component
      idleConnections - the value for the idleConnections record component
      totalCreated - the value for the totalCreated record component
      totalDestroyed - the value for the totalDestroyed record component
      currentWaitCount - the value for the currentWaitCount record component
      averageWaitTime - the value for the averageWaitTime record component
      connectionErrors - the value for the connectionErrors record component
      totalWaitCount - the value for the totalWaitCount record component
      totalWaitTimeMs - the value for the totalWaitTimeMs record component
      capturedAt - the value for the capturedAt 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • activeConnections

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

      public long idleConnections()
      Returns the value of the idleConnections record component.
      Returns:
      the value of the idleConnections record component
    • totalCreated

      public long totalCreated()
      Returns the value of the totalCreated record component.
      Returns:
      the value of the totalCreated record component
    • totalDestroyed

      public long totalDestroyed()
      Returns the value of the totalDestroyed record component.
      Returns:
      the value of the totalDestroyed record component
    • currentWaitCount

      public long currentWaitCount()
      Returns the value of the currentWaitCount record component.
      Returns:
      the value of the currentWaitCount record component
    • averageWaitTime

      public double averageWaitTime()
      Returns the value of the averageWaitTime record component.
      Returns:
      the value of the averageWaitTime record component
    • connectionErrors

      public long connectionErrors()
      Returns the value of the connectionErrors record component.
      Returns:
      the value of the connectionErrors record component
    • totalWaitCount

      public long totalWaitCount()
      Returns the value of the totalWaitCount record component.
      Returns:
      the value of the totalWaitCount record component
    • totalWaitTimeMs

      public long totalWaitTimeMs()
      Returns the value of the totalWaitTimeMs record component.
      Returns:
      the value of the totalWaitTimeMs record component
    • capturedAt

      public Instant capturedAt()
      Returns the value of the capturedAt record component.
      Returns:
      the value of the capturedAt record component