public class CountingConnectionPoolMonitor extends java.lang.Object implements ConnectionPoolMonitor
ConnectionPoolMonitor that employs counters to track stats such as
| Constructor and Description |
|---|
CountingConnectionPoolMonitor() |
| Modifier and Type | Method and Description |
|---|---|
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 |
getHostReactivatedCount() |
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 |
getNumBusyConnections() |
long |
getNumOpenConnections() |
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.
|
java.lang.String |
toString() |
public void incOperationFailure(Host host, java.lang.Exception reason)
ConnectionPoolMonitorincOperationFailure in interface ConnectionPoolMonitorpublic long getOperationFailureCount()
getOperationFailureCount in interface ConnectionPoolMonitorpublic void incOperationSuccess(Host host, long latency)
ConnectionPoolMonitorincOperationSuccess in interface ConnectionPoolMonitorpublic long getOperationSuccessCount()
getOperationSuccessCount in interface ConnectionPoolMonitorpublic void incConnectionCreated(Host host)
ConnectionPoolMonitorincConnectionCreated in interface ConnectionPoolMonitorpublic long getConnectionCreatedCount()
getConnectionCreatedCount in interface ConnectionPoolMonitorpublic void incConnectionClosed(Host host, java.lang.Exception reason)
ConnectionPoolMonitorincConnectionClosed in interface ConnectionPoolMonitorreason - TODO: Make the host available to thispublic long getConnectionClosedCount()
getConnectionClosedCount in interface ConnectionPoolMonitorpublic void incConnectionCreateFailed(Host host, java.lang.Exception reason)
ConnectionPoolMonitorincConnectionCreateFailed in interface ConnectionPoolMonitorpublic long getConnectionCreateFailedCount()
getConnectionCreateFailedCount in interface ConnectionPoolMonitorpublic void incConnectionBorrowed(Host host, long delay)
ConnectionPoolMonitorincConnectionBorrowed in interface ConnectionPoolMonitorhost - Host from which the connection was borroweddelay - Time spent in the connection pool borrowing the connectionpublic long getConnectionBorrowedCount()
getConnectionBorrowedCount in interface ConnectionPoolMonitorpublic void incConnectionReturned(Host host)
ConnectionPoolMonitorincConnectionReturned in interface ConnectionPoolMonitorhost - Host to which connection is returnedpublic long getConnectionReturnedCount()
getConnectionReturnedCount in interface ConnectionPoolMonitorpublic long getPoolExhaustedTimeoutCount()
ConnectionPoolMonitorgetPoolExhaustedTimeoutCount in interface ConnectionPoolMonitorpublic long getSocketTimeoutCount()
getSocketTimeoutCount in interface ConnectionPoolMonitorpublic long getOperationTimeoutCount()
ConnectionPoolMonitorgetOperationTimeoutCount in interface ConnectionPoolMonitorpublic void incFailover(Host host, java.lang.Exception reason)
ConnectionPoolMonitorincFailover in interface ConnectionPoolMonitorpublic long getFailoverCount()
getFailoverCount in interface ConnectionPoolMonitorpublic void onHostAdded(Host host, HostConnectionPool<?> pool)
ConnectionPoolMonitoronHostAdded in interface ConnectionPoolMonitorpublic long getHostAddedCount()
ConnectionPoolMonitorgetHostAddedCount in interface ConnectionPoolMonitorpublic void onHostRemoved(Host host)
ConnectionPoolMonitoronHostRemoved in interface ConnectionPoolMonitorpublic long getHostRemovedCount()
ConnectionPoolMonitorgetHostRemovedCount in interface ConnectionPoolMonitorpublic void onHostDown(Host host, java.lang.Exception reason)
ConnectionPoolMonitoronHostDown in interface ConnectionPoolMonitorreason - Exception that caused the host to be identified as downpublic long getHostDownCount()
getHostDownCount in interface ConnectionPoolMonitorpublic void onHostReactivated(Host host, HostConnectionPool<?> pool)
ConnectionPoolMonitoronHostReactivated in interface ConnectionPoolMonitorpublic long getHostReactivatedCount()
public long getNoHostCount()
getNoHostCount in interface ConnectionPoolMonitorpublic long getUnknownErrorCount()
getUnknownErrorCount in interface ConnectionPoolMonitorpublic long getInterruptedCount()
getInterruptedCount in interface ConnectionPoolMonitorpublic long getTransportErrorCount()
getTransportErrorCount in interface ConnectionPoolMonitorpublic long getBadRequestCount()
getBadRequestCount in interface ConnectionPoolMonitorpublic long getNumBusyConnections()
public long getNumOpenConnections()
public long notFoundCount()
notFoundCount in interface ConnectionPoolMonitorpublic long getHostCount()
getHostCount in interface ConnectionPoolMonitorpublic long getHostActiveCount()
getHostActiveCount in interface ConnectionPoolMonitorpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Map<Host,HostStats> getHostStats()
getHostStats in interface ConnectionPoolMonitor