Class ConnectionPoolMonitor
java.lang.Object
is.codion.swing.framework.server.monitor.ConnectionPoolMonitor
A ConnectionPoolMonitor
-
Constructor Summary
ConstructorsConstructorDescriptionConnectionPoolMonitor(is.codion.common.db.pool.ConnectionPoolWrapper connectionPool, int updateRate) Instantiates a newConnectionPoolMonitor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStatisticsListener(Runnable listener) org.jfree.data.xy.IntervalXYDatasetvoidClears all graph data setsis.codion.common.state.Stateis.codion.common.state.Stateis.codion.common.db.pool.ConnectionPoolStatisticsbooleanorg.jfree.data.xy.XYDatasetis.codion.common.value.Value<Integer>is.codion.common.value.Value<Integer>is.codion.common.value.Value<Integer>is.codion.common.value.Value<Integer>is.codion.common.value.Value<Integer>org.jfree.data.xy.XYDatasetvoidResets all collected pool statisticsvoidshutdown()Shuts down this pool monitororg.jfree.data.xy.XYDatasetis.codion.common.value.Value<Integer>username()
-
Constructor Details
-
ConnectionPoolMonitor
public ConnectionPoolMonitor(is.codion.common.db.pool.ConnectionPoolWrapper connectionPool, int updateRate) Instantiates a newConnectionPoolMonitor- Parameters:
connectionPool- the connection pool to monitorupdateRate- the initial statistics update rate in seconds
-
-
Method Details
-
username
- Returns:
- the user the connection pool is based on
-
connectionPoolStatistics
public is.codion.common.db.pool.ConnectionPoolStatistics connectionPoolStatistics()- Returns:
- the latest pool statistics
-
pooledConnectionTimeout
- Returns:
- the pool connection timeout in milliseconds
-
poolCleanupInterval
- Returns:
- the pool maintenance interval in seconds
-
minimumPoolSize
- Returns:
- the minimum pool size to maintain
-
maximumPoolSize
- Returns:
- the maximum allowed pool size
-
maximumCheckOutTime
- 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
-
resetStatistics
public void resetStatistics()Resets all collected pool statistics -
clearStatistics
public void clearStatistics()Clears all graph data sets -
collectSnapshotStatistics
public is.codion.common.state.State collectSnapshotStatistics()- Returns:
- the State controlling whether snapshot statistics are collected
-
collectCheckOutTimes
public is.codion.common.state.State collectCheckOutTimes()- Returns:
- the State controlling whether checkout times are collected
-
addStatisticsListener
- Parameters:
listener- notified each time the statistics are updated
-
updateInterval
- Returns:
- the value controlling the update interval
-
shutdown
public void shutdown()Shuts down this pool monitor
-