com.netflix.astyanax.connectionpool
Interface ConnectionPoolMonitor

All Known Implementing Classes:
CountingConnectionPoolMonitor, EmptyConnectionPoolMonitor

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.

Author:
elandau

Method Summary
 long getConnectionBorrowedCount()
           
 long getConnectionClosedCount()
           
 long getConnectionCreatedCount()
           
 long getConnectionCreateFailedCount()
           
 long getConnectionReturnedCount()
           
 long getFailoverCount()
           
 Map<Host,HostStats> getHostStats()
          Return a mapping of all hosts and their statistics
 long getNoHostCount()
           
 long getOperationFailureCount()
           
 long getOperationSuccessCount()
           
 long getOperationTimeoutCount()
           
 long getPoolExhaustedTimeoutCount()
           
 void incConnectionBorrowed(Host host, long delay)
          Incremented for each connection borrowed
 void incConnectionClosed(Host host, Exception reason)
          Closed a connection
 void incConnectionCreated(Host host)
          Created a connection successfully
 void incConnectionCreateFailed(Host host, Exception reason)
          Attempt to create a connection failed
 void incConnectionReturned(Host host)
          Incremented for each connection returned.
 void incFailover(Host host, Exception reason)
          An operation failed by the connection pool will attempt to fail over to another host/connection.
 void incNoHosts()
          There were no active hosts in the pool to borrow from.
 void incOperationFailure(Host host, Exception reason)
          Errors trying to execute an operation
 void incOperationSuccess(Host host, long latency)
          Succeeded in executing an operation
 void incOperationTimeout()
          Timeout waiting for a response from the cluster
 void incPoolExhaustedTimeout()
          Timeout trying to get a connection from the pool
 void onHostAdded(Host host, HostConnectionPool<?> pool)
          A host was added and given the associated pool.
 void onHostDown(Host host, 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,
                         Exception reason)
Errors trying to execute an operation

Parameters:
reason -
host -

getOperationFailureCount

long getOperationFailureCount()

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,
                         Exception reason)
Closed a connection

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

getConnectionClosedCount

long getConnectionClosedCount()

incConnectionCreateFailed

void incConnectionCreateFailed(Host host,
                               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()

incPoolExhaustedTimeout

void incPoolExhaustedTimeout()
Timeout trying to get a connection from the pool


getPoolExhaustedTimeoutCount

long getPoolExhaustedTimeoutCount()

incOperationTimeout

void incOperationTimeout()
Timeout waiting for a response from the cluster


getOperationTimeoutCount

long getOperationTimeoutCount()

incFailover

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


getFailoverCount

long getFailoverCount()

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,
                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 -

incNoHosts

void incNoHosts()
There were no active hosts in the pool to borrow from.


getNoHostCount

long getNoHostCount()

getHostStats

Map<Host,HostStats> getHostStats()
Return a mapping of all hosts and their statistics

Returns:


Copyright © 2012. All Rights Reserved.