voldemort.store.stats
Class ClientSocketStats

java.lang.Object
  extended by voldemort.store.stats.ClientSocketStats

public class ClientSocketStats
extends java.lang.Object

Some convenient statistics to track about the client requests


Constructor Summary
ClientSocketStats(ClientSocketStats parent, SocketDestination destination, QueuedKeyedResourcePool<SocketDestination,ClientRequestExecutor> pool, int jmxId)
          To construct a per node stats object
ClientSocketStats(int jmxId)
          Construction of a new aggregate stats object
 
Method Summary
protected  void checkMonitoringInterval()
           
 void close()
          Unregister all MBeans
 void connectionCreate(SocketDestination dest)
           
 void connectionDestroy(SocketDestination dest)
           
 long getAvgCheckoutWaitUs()
           
 long getAvgResourceRequestWaitUs()
           
 int getCheckoutCount()
           
 Histogram getCheckoutQueueLengthHistogram()
           
 Histogram getCheckoutWaitUsHistogram()
           
 int getConnectionsActive(SocketDestination destination)
           
 int getConnectionsCreated()
           
 int getConnectionsDestroyed()
           
 int getConnectionsInPool(SocketDestination destination)
           
 int getMonitoringInterval()
           
 Histogram getResourceRequestQueueLengthHistogram()
           
 Histogram getResourceRequestWaitUsHistogram()
           
 java.util.concurrent.ConcurrentMap<SocketDestination,ClientSocketStats> getStatsMap()
           
 void recordCheckoutQueueLength(SocketDestination dest, int queueLength)
          Record the checkout queue length
 void recordCheckoutTimeUs(SocketDestination dest, long checkoutTimeUs)
          Record the checkout wait time in us
 void recordResourceRequestQueueLength(SocketDestination dest, int queueLength)
          Record the resource request queue length
 void recordResourceRequestTimeUs(SocketDestination dest, long resourceRequestTimeUs)
          Record the resource request wait time in us
protected  void resetForInterval()
          Reset all of the stats counters
 int resourceRequestCount()
           
 void setMonitoringInterval(int count)
           
 void setPool(QueuedKeyedResourcePool<SocketDestination,ClientRequestExecutor> pool)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientSocketStats

public ClientSocketStats(ClientSocketStats parent,
                         SocketDestination destination,
                         QueuedKeyedResourcePool<SocketDestination,ClientRequestExecutor> pool,
                         int jmxId)
To construct a per node stats object

Parameters:
parent - An optional parent stats object that will maintain aggregate data across many sockets
destination - The destination object that defines the node
pool - The socket pool that will give out connection information

ClientSocketStats

public ClientSocketStats(int jmxId)
Construction of a new aggregate stats object

Parameters:
jmxId - the jmx id
Method Detail

recordCheckoutTimeUs

public void recordCheckoutTimeUs(SocketDestination dest,
                                 long checkoutTimeUs)
Record the checkout wait time in us

Parameters:
dest - Destination of the socket to checkout. Will actually record if null. Otherwise will call this on self and corresponding child with this param null.
checkoutTimeUs - The number of us to wait before getting a socket

recordCheckoutQueueLength

public void recordCheckoutQueueLength(SocketDestination dest,
                                      int queueLength)
Record the checkout queue length

Parameters:
dest - Destination of the socket to checkout. Will actually record if null. Otherwise will call this on self and corresponding child with this param null.
queueLength - The number of entries in the "synchronous" checkout queue.

recordResourceRequestTimeUs

public void recordResourceRequestTimeUs(SocketDestination dest,
                                        long resourceRequestTimeUs)
Record the resource request wait time in us

Parameters:
dest - Destination of the socket for which the resource was requested. Will actually record if null. Otherwise will call this on self and corresponding child with this param null.
resourceRequestTimeUs - The number of us to wait before getting a socket

recordResourceRequestQueueLength

public void recordResourceRequestQueueLength(SocketDestination dest,
                                             int queueLength)
Record the resource request queue length

Parameters:
dest - Destination of the socket for which resource request is enqueued. Will actually record if null. Otherwise will call this on self and corresponding child with this param null.
queueLength - The number of entries in the "asynchronous" resource request queue.

connectionCreate

public void connectionCreate(SocketDestination dest)

connectionDestroy

public void connectionDestroy(SocketDestination dest)

getConnectionsCreated

public int getConnectionsCreated()

getConnectionsDestroyed

public int getConnectionsDestroyed()

getCheckoutCount

public int getCheckoutCount()

getCheckoutWaitUsHistogram

public Histogram getCheckoutWaitUsHistogram()

getAvgCheckoutWaitUs

public long getAvgCheckoutWaitUs()
Returns:
0 if there have been no checkout invocations

getCheckoutQueueLengthHistogram

public Histogram getCheckoutQueueLengthHistogram()

resourceRequestCount

public int resourceRequestCount()

getResourceRequestWaitUsHistogram

public Histogram getResourceRequestWaitUsHistogram()

getAvgResourceRequestWaitUs

public long getAvgResourceRequestWaitUs()
Returns:
0 if there have been no resourceRequest invocations

getResourceRequestQueueLengthHistogram

public Histogram getResourceRequestQueueLengthHistogram()

getConnectionsActive

public int getConnectionsActive(SocketDestination destination)

getConnectionsInPool

public int getConnectionsInPool(SocketDestination destination)

setMonitoringInterval

public void setMonitoringInterval(int count)

getMonitoringInterval

public int getMonitoringInterval()

checkMonitoringInterval

protected void checkMonitoringInterval()

resetForInterval

protected void resetForInterval()
Reset all of the stats counters


setPool

public void setPool(QueuedKeyedResourcePool<SocketDestination,ClientRequestExecutor> pool)

getStatsMap

public java.util.concurrent.ConcurrentMap<SocketDestination,ClientSocketStats> getStatsMap()

close

public void close()
Unregister all MBeans



Jay Kreps, Roshan Sumbaly, Alex Feinberg, Bhupesh Bansal, Lei Gao, Chinmay Soman, Vinoth Chandar, Zhongjie Wu