Package oracle.ucp

Interface UniversalConnectionPoolStatistics

  • All Known Subinterfaces:
    JDBCConnectionPoolStatistics, OracleJDBCConnectionPoolStatistics

    public interface UniversalConnectionPoolStatistics
    Various runtime statistics for the Universal Connection Pool. This interface provides query-only operations on all available pool statistics.

    The cumulative statistics are collected across multiple pool start/stop cycles, while the others only apply to the current running connection pool instance.

    See Also:
    UniversalConnectionPool
    • Method Detail

      • getTotalConnectionsCount

        int getTotalConnectionsCount()
        Gets the total number of connections (both available and borrowed) in the connection pool.
        Returns:
        The total number of connections (both available and borrowed) in the connection pool.
      • getAvailableConnectionsCount

        int getAvailableConnectionsCount()
        Gets the number of connections that are available in the connection pool (that is, connections in the pool that are not currently in use by clients).
        Returns:
        The number of connections that are available in the connection pool.
      • getBorrowedConnectionsCount

        int getBorrowedConnectionsCount()
        Gets the number of connections that are actively in use by clients.
        Returns:
        The number of connections that are actively in use by clients.
      • getAverageBorrowedConnectionsCount

        int getAverageBorrowedConnectionsCount()
        Gets the average number of connections that are borrowed and actively in use by clients.
        Returns:
        The number of connections that are borrowed and actively in use by clients.
      • getPeakConnectionsCount

        int getPeakConnectionsCount()
        Gets the maximum number of connections that the connection pool has reached during the life of the pool.
        Returns:
        The maximum number of connections that the connection pool has reached during the life of the pool.
      • getPeakBorrowedConnectionsCount

        default int getPeakBorrowedConnectionsCount()
        Gets the maximum number of borrowed connections that the connection pool has reached during the life of the pool.
        Returns:
        The maximum number of borrowed connections that the connection pool has reached during the life of the pool.
      • getRemainingPoolCapacityCount

        int getRemainingPoolCapacityCount()
        Gets the number of connections that may be added to the pool before it reaches maxPoolSize.
        Returns:
        The number of connections that may be added to the pool before it reaches maxPoolSize.
      • getLabeledConnectionsCount

        int getLabeledConnectionsCount()
        Gets the number of labeled connections in the connection pool.
        Returns:
        The number of labeled connections in the connection pool.
      • getConnectionsCreatedCount

        int getConnectionsCreatedCount()
        Gets the number of connections created for this connection pool.
        Returns:
        The number of connections created for this connection pool.
      • getConnectionsClosedCount

        int getConnectionsClosedCount()
        Gets the number of connections closed by this connection pool.
        Returns:
        The number of connections closed by this connection pool.
      • getAverageConnectionWaitTime

        long getAverageConnectionWaitTime()
        Gets the average time (in milliseconds) a user thread has to wait before it could obtain a connection from the connection pool.
        Returns:
        The average time (in milliseconds) a user thread has to wait before it could obtain a connection from the connection pool.
      • getPeakConnectionWaitTime

        long getPeakConnectionWaitTime()
        Gets the longest wait (in milliseconds) a user request has to incur before obtaining a connection from the connection pool. This includes threads that waited unsuccessfully for a connection.
        Returns:
        The longest wait (in milliseconds) a user request has to incur before obtaining a connection from the connection pool.
      • getAbandonedConnectionsCount

        int getAbandonedConnectionsCount()
        Gets the number of abandoned connections that have been reclaimed.
        Returns:
        The number of abandoned connections that have been reclaimed.
      • getPendingRequestsCount

        int getPendingRequestsCount()
        Gets the number of clients that are currently waiting to obtain a connection from the pool.
        Returns:
        The number of clients that are currently waiting to obtain a connection from the pool.
      • getCumulativeConnectionWaitTime

        long getCumulativeConnectionWaitTime()
        Gets the cumulative time (in milliseconds) that connection requests have waited for connections over the life of the connection pool. This includes the time connections waited successfully and obtained a connection from the pool and those that failed waiting for a connection.
        Returns:
        The cumulative time (in milliseconds) that connection requests have waited for connections over the life of the connection pool.
      • getCumulativeConnectionBorrowedCount

        long getCumulativeConnectionBorrowedCount()
        Gets the number of connections borrowed from the connection pool over the life of the pool. This count is incremented each time a connection is borrowed.
        Returns:
        The number of connections borrowed from the connection pool over the life of the pool.
      • getCumulativeConnectionUseTime

        long getCumulativeConnectionUseTime()
        Gets the cumulative time (in milliseconds) of connections that were borrowed from the pool and remained in use.
        Returns:
        The cumulative time (in milliseconds) of connections that were borrowed from the pool and remained in use.
      • getCumulativeConnectionReturnedCount

        long getCumulativeConnectionReturnedCount()
        Gets the number of connections returned to the connection pool over the life of the pool.
        Returns:
        The number of connections returned to the connection pool over the life of the pool.
      • getCumulativeSuccessfulConnectionWaitTime

        long getCumulativeSuccessfulConnectionWaitTime()
        Gets the cumulative time (in milliseconds) that connection requests waited successfully and borrowed a connection from the pool.
        Returns:
        The cumulative time (in milliseconds) that connection requests waited successfully and borrowed a connection from the pool.
      • getCumulativeSuccessfulConnectionWaitCount

        long getCumulativeSuccessfulConnectionWaitCount()
        Gets the number of connection requests that waited successfully and borrowed a connection from the pool.
        Returns:
        The number of connection requests that waited successfully and borrowed a connection from the pool.
      • getCumulativeFailedConnectionWaitTime

        long getCumulativeFailedConnectionWaitTime()
        Gets the cumulative time (in milliseconds) that connection requests waited but failed to borrow a connection from the pool.
        Returns:
        The cumulative time (in milliseconds) that connection requests waited but failed to borrow a connection from the pool.
      • getCumulativeFailedConnectionWaitCount

        long getCumulativeFailedConnectionWaitCount()
        Gets the number of connection requests that waited unsuccessfully to borrow a connection from the pool.
        Returns:
        The number of connection requests that waited unsuccessfully to borrow a connection from the pool.
      • getCumulativeConnectionCreationAttemts

        default long getCumulativeConnectionCreationAttemts()
        Gets the number of connection creation attempts during database outages when the driver threw SQLRecoverableException (temporary issue). This is cumulative counter, it counts since the pool data source started or restarted.
        Returns:
        number of attempts
      • getConnectionCreationAttemptsSinceLastOutage

        default long getConnectionCreationAttemptsSinceLastOutage()
        Gets the number of connection creation attempts during database outages when the driver threw SQLRecoverableException (temporary issue). This is cumulative counter, but it counts most recent outage. It gets cleared out at the first successful connection creation operation..
        Returns:
        number of attempts
      • getShardConnectionStats

        default java.util.Map<java.lang.String,​oracle.ucp.ShardConnectionStatistics> getShardConnectionStats()
        Returns a map containing shard connection statistics object for various shards discovered by the pool so far. The ShardConnectionStatistics object contains information such as total connection count, borrowed connection count and available connection count for a shard.
        Returns:
        map containing shard connection statistics object for various shards discovered by the pool so far. A Map's key is a shard's name.
      • shortForm

        default java.lang.String shortForm()
        Get statistics in the short form (is used in exception messages).

        Example:

        [ 100, 100, 5959, 5859, 0, 100, 16, 0, 100, 99 ],

        or commonly:

        [ Borrowed, Total, Created, Closed, Abandoned, Labeled, PendingRequests, RemainingCapacity, PeakCount ]

        where:

        • Borrowed          - number of borrowed connections in a pool;
        • Total             - number of total connections in a pool;
        • Created           - cumulative number of connection created since a pool's startup;
        • Closed            - cumulative number of connections closed since a pool's startup;
        • Abandoned         - cumulative number of abandoned connections (i.e. processed by the abandonement timer mechanism);
        • Labeled           - number of labeled connections in a pool;
        • PendingRequests   - number of pending borrow requests;
        • RemainingCapacity - number of connections to create over an existing set until the max pool size is reached;
        • PeakCount         - number of connections at its peak since a pool's startup.
        • PeakBorrowedCount - number of borrowed connections at its peak since a pool's startup.
        Returns:
        short form of statistics as a string, with described format.