Class ConnectionPoolMonitor


  • public final class ConnectionPoolMonitor
    extends Object
    A ConnectionPoolMonitor
    • Constructor Detail

      • ConnectionPoolMonitor

        public ConnectionPoolMonitor​(ConnectionPoolWrapper connectionPool,
                                     int updateRate)
        Instantiates a new ConnectionPoolMonitor
        Parameters:
        connectionPool - the connection pool to monitor
        updateRate - the initial statistics update rate in seconds
    • Method Detail

      • username

        public String username()
        Returns:
        the user the connection pool is based on
      • connectionPoolStatistics

        public ConnectionPoolStatistics connectionPoolStatistics()
        Returns:
        the latest pool statistics
      • pooledConnectionTimeoutValue

        public Value<Integer> pooledConnectionTimeoutValue()
        Returns:
        the pool connection timeout in milliseconds
      • poolCleanupIntervalValue

        public Value<Integer> poolCleanupIntervalValue()
        Returns:
        the pool maintenance interval in seconds
      • minimumPoolSizeValue

        public Value<Integer> minimumPoolSizeValue()
        Returns:
        the minimum pool size to maintain
      • maximumPoolSizeValue

        public Value<Integer> maximumPoolSizeValue()
        Returns:
        the maximum allowed pool size
      • maximumCheckOutTimeValue

        public Value<Integer> maximumCheckOutTimeValue()
        Returns:
        the maximum wait time for a connection
      • datasetContainsData

        public boolean datasetContainsData()
        Returns:
        true if the graph datasets contain data
      • snapshotDataset

        public org.jfree.data.xy.XYDataset snapshotDataset()
        Returns:
        the dataset for snapshot pool stats
      • inPoolDataset

        public org.jfree.data.xy.XYDataset inPoolDataset()
        Returns:
        the dataset for the number of connections in the pool
      • requestsPerSecondDataset

        public org.jfree.data.xy.XYDataset requestsPerSecondDataset()
        Returns:
        the dataset for the number of connection requests per second
      • checkOutTimeCollection

        public org.jfree.data.xy.IntervalXYDataset checkOutTimeCollection()
        Returns:
        the dataset for the connection check out time
      • clearStatistics

        public void clearStatistics()
        Resets all collected pool statistics
      • clearInPoolStatistics

        public void clearInPoolStatistics()
        Clears all graph data sets
      • collectSnapshotStatisticsState

        public State collectSnapshotStatisticsState()
        Returns:
        the State controlling whether snapshot statistics are collected
      • collectCheckOutTimesState

        public State collectCheckOutTimesState()
        Returns:
        the State controlling whether checkout times are collected
      • statisticsObserver

        public EventObserver<?> statisticsObserver()
        Returns:
        EventObserver notified when statistics have been updated
      • updateIntervalValue

        public Value<Integer> updateIntervalValue()
        Returns:
        the value controlling the update interval
      • shutdown

        public void shutdown()
        Shuts down this pool monitor