Interface IDataSourceInfo
public interface IDataSourceInfo
Information about a
DataSource's runtime state, such as the number of active and idle connections.- Since:
- 8.5.0
- Author:
- Norman Lorenz
-
Method Summary
Modifier and TypeMethodDescriptionintGet the number of currently active connections in the pool.Get the connection identifier associated with this DataSource.default DbmsgetDbms()Gets the dbms type associated with this DataSource.default StringGet a display name for this DataSource.intGet the number of currently idle connections in the pool.Get the JDBC URL used by this DataSource.Get the timestamp of when the datasource was last accessed.Get the timestamp of when the datasource was started.intGet the number of threads awaiting connections from the pool.intGet the total number of connections currently in the pool.Get the duration for which the datasource has been up.default booleanCheck if this DataSource is for the system database.
-
Method Details
-
getActiveConnections
int getActiveConnections()Get the number of currently active connections in the pool.The return value is extremely transient and is a point-in-time measurement. Therefore, due to a time difference between invoking this method and
getIdleConnections(), it is possible for the sum of idle plus active connections to be either less than or greater than the value returned bygetTotalConnections().- Returns:
- the current number of active (in-use) connections in the pool
-
getConnectionIdentifier
ConnectionIdentifier getConnectionIdentifier()Get the connection identifier associated with this DataSource.- Returns:
- the connection identifier
-
getDisplayName
Get a display name for this DataSource.- Returns:
- a display name for this DataSource
-
getIdleConnections
int getIdleConnections()Get the number of currently idle connections in the pool.The return value is extremely transient and is a point-in-time measurement. Therefore, due to a time difference between invoking this method and
getActiveConnections(), it is possible for the sum of idle plus active connections to be either less than or greater than the value returned bygetTotalConnections().- Returns:
- the current number of idle connections in the pool
-
getJdbcUrl
-
getLastAccessTimestamp
Instant getLastAccessTimestamp()Get the timestamp of when the datasource was last accessed.- Returns:
- the timestamp of when the datasource was last accessed
-
getStartedTimestamp
Instant getStartedTimestamp()Get the timestamp of when the datasource was started.- Returns:
- the timestamp of when the datasource was started
-
getThreadsAwaitingConnection
int getThreadsAwaitingConnection()Get the number of threads awaiting connections from the pool. The return value is extremely transient and is a point-in-time measurement.- Returns:
- the number of threads awaiting a connection from the pool
-
getTotalConnections
int getTotalConnections()Get the total number of connections currently in the pool. The return value is transient and is a point-in-time measurement.- Returns:
- the total number of connections in the pool
-
getUptime
Duration getUptime()Get the duration for which the datasource has been up.- Returns:
- the duration for which the datasource has been up
-
getDbms
Gets the dbms type associated with this DataSource.- Returns:
- the dbms type associated with this DataSource
-
isSystemDb
default boolean isSystemDb()Check if this DataSource is for the system database.- Returns:
- true if this DataSource is for the system database, false otherwise
-