com.unboundid.ldap.sdk
Class LDAPConnectionPoolStatistics

java.lang.Object
  extended by com.unboundid.ldap.sdk.LDAPConnectionPoolStatistics
All Implemented Interfaces:
java.io.Serializable

@Mutable
@ThreadSafety(level=MOSTLY_THREADSAFE)
public final class LDAPConnectionPoolStatistics
extends java.lang.Object
implements java.io.Serializable

This class provides a data structure with information about usage of an LDAP connection pool. Calls to update statistics maintained by this class are threadsafe, but attempts to access different statistics may not be consistent if operations may be in progress in the connection pool.

The set of statistics maintained for connection pools include:

See Also:
Serialized Form

Constructor Summary
LDAPConnectionPoolStatistics(AbstractConnectionPool pool)
          Creates a new instance of this LDAP connection pool statistics object.
 
Method Summary
 int getMaximumAvailableConnections()
          Retrieves the maximum number of connections that may be available in the pool at any time, if that information is available.
 int getNumAvailableConnections()
          Retrieves the number of connections currently available for use in the pool, if that information is available.
 long getNumConnectionsClosedDefunct()
          Retrieves the number of connections that have been closed as defunct (i.e., they are no longer believed to be valid).
 long getNumConnectionsClosedExpired()
          Retrieves the number of connections that have been closed as expired (i.e., they have been established for longer than the maximum connection age for the pool).
 long getNumConnectionsClosedUnneeded()
          Retrieves the number of connections that have been closed as unneeded (i.e., they were created in response to heavy load but are no longer needed to meet the current load, or they were closed when the pool was closed).
 long getNumFailedCheckouts()
          Retrieves the number of failed attempts to check out a connection from the pool (including connections checked out for internal use by operations processed as part of the pool).
 long getNumFailedConnectionAttempts()
          Retrieves the number of failed attempts to create a connection for use in the connection pool.
 long getNumReleasedValid()
          Retrieves the number of times a valid, usable connection has been released back to the pool after being checked out (including connections checked out for internal use by operations processed within the pool).
 long getNumSuccessfulCheckouts()
          Retrieves the number of successful attempts to check out a connection from the pool (including connections checked out for internal use by operations processed as part of the pool).
 long getNumSuccessfulCheckoutsAfterWaiting()
          Retrieves the number of successful attempts to check out a connection from the pool that had to wait for a connection to become available.
 long getNumSuccessfulCheckoutsNewConnection()
          Retrieves the number of successful attempts to check out a connection from the pool that had to create a new connection because no existing connections were available.
 long getNumSuccessfulCheckoutsWithoutWaiting()
          Retrieves the number of successful attempts to check out a connection from the pool that were able to obtain an existing connection without waiting.
 long getNumSuccessfulConnectionAttempts()
          Retrieves the number of connections that have been successfully created for use in conjunction with the connection pool.
 void reset()
          Resets all counters back to zero.
 java.lang.String toString()
          Retrieves a string representation of this LDAP connection pool statistics object.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this LDAP connection pool statistics object to the provided buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LDAPConnectionPoolStatistics

public LDAPConnectionPoolStatistics(AbstractConnectionPool pool)
Creates a new instance of this LDAP connection pool statistics object. All of the counts will be initialized to zero.

Parameters:
pool - The connection pool with which these statistics are associated.
Method Detail

reset

public void reset()
Resets all counters back to zero.


getNumSuccessfulConnectionAttempts

public long getNumSuccessfulConnectionAttempts()
Retrieves the number of connections that have been successfully created for use in conjunction with the connection pool.

Returns:
The number of connections that have been created for use in conjunction with the connection pool.

getNumFailedConnectionAttempts

public long getNumFailedConnectionAttempts()
Retrieves the number of failed attempts to create a connection for use in the connection pool.

Returns:
The number of failed attempts to create a connection for use in the connection pool.

getNumConnectionsClosedDefunct

public long getNumConnectionsClosedDefunct()
Retrieves the number of connections that have been closed as defunct (i.e., they are no longer believed to be valid).

Returns:
The number of connections that have been closed as defunct.

getNumConnectionsClosedExpired

public long getNumConnectionsClosedExpired()
Retrieves the number of connections that have been closed as expired (i.e., they have been established for longer than the maximum connection age for the pool).

Returns:
The number of connections that have been closed as expired.

getNumConnectionsClosedUnneeded

public long getNumConnectionsClosedUnneeded()
Retrieves the number of connections that have been closed as unneeded (i.e., they were created in response to heavy load but are no longer needed to meet the current load, or they were closed when the pool was closed).

Returns:
The number of connections that have been closed as unneeded.

getNumSuccessfulCheckouts

public long getNumSuccessfulCheckouts()
Retrieves the number of successful attempts to check out a connection from the pool (including connections checked out for internal use by operations processed as part of the pool).

Returns:
The number of successful attempts to check out a connection from the pool.

getNumSuccessfulCheckoutsWithoutWaiting

public long getNumSuccessfulCheckoutsWithoutWaiting()
Retrieves the number of successful attempts to check out a connection from the pool that were able to obtain an existing connection without waiting.

Returns:
The number of successful attempts to check out a connection from the pool that were able to obtain an existing connection without waiting.

getNumSuccessfulCheckoutsAfterWaiting

public long getNumSuccessfulCheckoutsAfterWaiting()
Retrieves the number of successful attempts to check out a connection from the pool that had to wait for a connection to become available.

Returns:
The number of successful attempts to check out a connection from the pool that had to wait for a connection to become available.

getNumSuccessfulCheckoutsNewConnection

public long getNumSuccessfulCheckoutsNewConnection()
Retrieves the number of successful attempts to check out a connection from the pool that had to create a new connection because no existing connections were available.

Returns:
The number of successful attempts to check out a connection from the pool that had to create a new connection because no existing connections were available.

getNumFailedCheckouts

public long getNumFailedCheckouts()
Retrieves the number of failed attempts to check out a connection from the pool (including connections checked out for internal use by operations processed as part of the pool).

Returns:
The number of failed attempts to check out a connection from the pool.

getNumReleasedValid

public long getNumReleasedValid()
Retrieves the number of times a valid, usable connection has been released back to the pool after being checked out (including connections checked out for internal use by operations processed within the pool).

Returns:
The number of times a valid connection has been released back to the pool.

getNumAvailableConnections

public int getNumAvailableConnections()
Retrieves the number of connections currently available for use in the pool, if that information is available.

Returns:
The number of connections currently available for use in the pool, or -1 if that is not applicable for the associated connection pool implementation.

getMaximumAvailableConnections

public int getMaximumAvailableConnections()
Retrieves the maximum number of connections that may be available in the pool at any time, if that information is available.

Returns:
The maximum number of connections that may be available in the pool at any time, or -1 if that is not applicable for the associated connection pool implementation.

toString

public java.lang.String toString()
Retrieves a string representation of this LDAP connection pool statistics object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this LDAP connection pool statistics object.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP connection pool statistics object to the provided buffer.

Parameters:
buffer - The buffer to which the string representation should be appended.