com.netflix.astyanax.connectionpool
Interface ConnectionPoolMonitor

All Known Implementing Classes:
CountingConnectionPoolMonitor, EmptyConnectionPoolMonitor, Slf4jConnectionPoolMonitorImpl

public interface ConnectionPoolMonitor

Monitoring interface to receive notification of pool events. A concrete monitor will make event stats available to a monitoring application and may also log events to a log file.


Method Summary
 long getBadRequestCount()
           
 long getConnectionBorrowedCount()
           
 long getConnectionClosedCount()
           
 long getConnectionCreatedCount()
           
 long getConnectionCreateFailedCount()
           
 long getConnectionReturnedCount()
           
 long getFailoverCount()
           
 long getHostActiveCount()
           
 long getHostAddedCount()
          Return the number of times a host was added to the pool.
 long getHostCount()
           
 long getHostDownCount()
           
 long getHostRemovedCount()
          Return the number of times any host was removed to the pool.
 java.util.Map<Host,HostStats> getHostStats()
           
 long getInterruptedCount()
           
 long getNoHostCount()
           
 long getOperationFailureCount()
           
 long getOperationSuccessCount()
           
 long getOperationTimeoutCount()
          Timeout waiting for a response from the cluster
 long getPoolExhaustedTimeoutCount()
          Timeout trying to get a connection from the pool
 long getSocketTimeoutCount()
           
 long getTransportErrorCount()
           
 long getUnknownErrorCount()
           
 void incConnectionBorrowed(Host host, long delay)
          Incremented for each connection borrowed
 void incConnectionClosed(Host host, java.lang.Exception reason)
          Closed a connection
 void incConnectionCreated(Host host)
          Created a connection successfully
 void incConnectionCreateFailed(Host host, java.lang.Exception reason)
          Attempt to create a connection failed
 void incConnectionReturned(Host host)
          Incremented for each connection returned.
 void incFailover(Host host, java.lang.Exception reason)
          An operation failed but the connection pool will attempt to fail over to another host/connection.
 void incOperationFailure(Host host, java.lang.Exception reason)
          Errors trying to execute an operation.
 void incOperationSuccess(Host host, long latency)
          Succeeded in executing an operation
 long notFoundCount()
           
 void onHostAdded(Host host, HostConnectionPool<?> pool)
          A host was added and given the associated pool.
 void onHostDown(Host host, java.lang.Exception reason)
          A host was identified as downed.
 void onHostReactivated(Host host, HostConnectionPool<?> pool)
          A host was reactivated after being marked down
 void onHostRemoved(Host host)
          A host was removed from the pool.
 

Method Detail

incOperationFailure

void incOperationFailure(Host host,
                         java.lang.Exception reason)
Errors trying to execute an operation.

Parameters:
reason -
host -

getOperationFailureCount

long getOperationFailureCount()

incFailover

void incFailover(Host host,
                 java.lang.Exception reason)
An operation failed but the connection pool will attempt to fail over to another host/connection.


getFailoverCount

long getFailoverCount()

incOperationSuccess

void incOperationSuccess(Host host,
                         long latency)
Succeeded in executing an operation

Parameters:
host -
latency -

getOperationSuccessCount

long getOperationSuccessCount()

incConnectionCreated

void incConnectionCreated(Host host)
Created a connection successfully


getConnectionCreatedCount

long getConnectionCreatedCount()

incConnectionClosed

void incConnectionClosed(Host host,
                         java.lang.Exception reason)
Closed a connection

Parameters:
reason - TODO: Make the host available to this

getConnectionClosedCount

long getConnectionClosedCount()

incConnectionCreateFailed

void incConnectionCreateFailed(Host host,
                               java.lang.Exception reason)
Attempt to create a connection failed

Parameters:
host -
reason -

getConnectionCreateFailedCount

long getConnectionCreateFailedCount()

incConnectionBorrowed

void incConnectionBorrowed(Host host,
                           long delay)
Incremented for each connection borrowed

Parameters:
host - Host from which the connection was borrowed
delay - Time spent in the connection pool borrowing the connection

getConnectionBorrowedCount

long getConnectionBorrowedCount()

incConnectionReturned

void incConnectionReturned(Host host)
Incremented for each connection returned.

Parameters:
host - Host to which connection is returned

getConnectionReturnedCount

long getConnectionReturnedCount()

getPoolExhaustedTimeoutCount

long getPoolExhaustedTimeoutCount()
Timeout trying to get a connection from the pool


getOperationTimeoutCount

long getOperationTimeoutCount()
Timeout waiting for a response from the cluster


getSocketTimeoutCount

long getSocketTimeoutCount()
Returns:
Count of socket timeouts trying to execute an operation

getUnknownErrorCount

long getUnknownErrorCount()
Returns:
Get number of unknown errors

getBadRequestCount

long getBadRequestCount()
Returns:
Get number of invalid requests (i.e. bad argument values)

getNoHostCount

long getNoHostCount()
Returns:
Count of times no hosts at all were available to execute an operation.

notFoundCount

long notFoundCount()
Returns:
Tracks the number of column not found error

getInterruptedCount

long getInterruptedCount()
Returns:
Number of times operations were cancelled

getTransportErrorCount

long getTransportErrorCount()
Returns:
Number of times transport errors occurred

getHostCount

long getHostCount()
Returns:
Return the number of hosts in the pool

getHostAddedCount

long getHostAddedCount()
Return the number of times a host was added to the pool. This number will be incremented multiple times if the same hosts is added and removed multiple times. A constantly increating number of host added and host removed may indicate a problem with the host discovery service


getHostRemovedCount

long getHostRemovedCount()
Return the number of times any host was removed to the pool. This number will be incremented multiple times if the same hosts is added and removed multiple times. A constantly increating number of host added and host removed may indicate a problem with the host discovery service


getHostDownCount

long getHostDownCount()
Returns:
Return the number of times any host was marked as down.

getHostActiveCount

long getHostActiveCount()
Returns:
Return the number of active hosts

onHostAdded

void onHostAdded(Host host,
                 HostConnectionPool<?> pool)
A host was added and given the associated pool. The pool is immutable and can be used to get info about the number of open connections

Parameters:
host -
pool -

onHostRemoved

void onHostRemoved(Host host)
A host was removed from the pool. This is usually called when a downed host is removed from the ring.

Parameters:
host -

onHostDown

void onHostDown(Host host,
                java.lang.Exception reason)
A host was identified as downed.

Parameters:
host -
reason - Exception that caused the host to be identified as down

onHostReactivated

void onHostReactivated(Host host,
                       HostConnectionPool<?> pool)
A host was reactivated after being marked down

Parameters:
host -
pool -

getHostStats

java.util.Map<Host,HostStats> getHostStats()
Returns:
Return a mapping of all hosts and their statistics