Interface ConnectionPoolMetricsMXBean


public interface ConnectionPoolMetricsMXBean
Exposes a single connection pool's metrics as a JMX MXBean, registered as is.codion:type=ConnectionPool,username=<username> on the platform MBean server when EntityServerConfiguration.JMX is enabled.

The counters (getRequests(), getFailedRequests(), getCreated() and getDestroyed()) are cumulative but are reset by EntityServerAdmin.resetConnectionPoolStatistics(String), so a consumer deriving rates must tolerate counter resets (the Prometheus rate() function does).

  • Method Details

    • getSize

      int getSize()
      Returns:
      the number of connections in the pool (getInUse() + getAvailable())
    • getAvailable

      int getAvailable()
      Returns:
      the number of available connections
    • getInUse

      int getInUse()
      Returns:
      the number of connections currently in use
    • getRequests

      int getRequests()
      Returns:
      the cumulative number of connection requests since the last reset
    • getFailedRequests

      int getFailedRequests()
      Returns:
      the cumulative number of failed connection requests since the last reset
    • getCreated

      int getCreated()
      Returns:
      the cumulative number of connections created since the last reset
    • getDestroyed

      int getDestroyed()
      Returns:
      the cumulative number of connections destroyed since the last reset
    • getAverageCheckOutTime

      long getAverageCheckOutTime()
      The average connection check-out time in microseconds, 0 unless check-out time collection is enabled via EntityServerAdmin.collectPoolCheckOutTimes(String, boolean).
      Returns:
      the average check-out time in microseconds