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


Nested Class Summary
static class ClientSocketStats.Tracked
           
 
Constructor Summary
ClientSocketStats(ClientSocketStats parent, SocketDestination destination, QueuedKeyedResourcePool<SocketDestination,ClientRequestExecutor> pool, java.lang.String identifierString)
          To construct a per node stats object
ClientSocketStats(java.lang.String identifierString)
          Construction of a new aggregate stats object
 
Method Summary
protected  void checkMonitoringInterval()
           
 void close()
          Unregister all MBeans
 double getAsyncOpTimeMsAvg()
           
 double getAsyncOpTimeMsQ95th()
           
 double getAsyncOpTimeMsQ99th()
           
 double getAvgCheckoutWaitMs()
           
 double getAvgConnectionEstablishmentMs()
           
 double getAvgResourceRequestTimeMs()
           
 int getCheckoutCount()
           
 Histogram getCheckoutQueueLengthHistogram()
           
 double getCheckoutTimeMsQ10th()
           
 double getCheckoutTimeMsQ50th()
           
 double getCheckoutTimeMsQ99th()
           
 double getConnectionEstablishmentQ99LatencyMs()
           
 int getConnectionsActive(SocketDestination destination)
           
 int getConnectionsInPool(SocketDestination destination)
           
 int getCount(ClientSocketStats.Tracked metric)
           
 int getMonitoringInterval()
           
 Histogram getResourceRequestQueueLengthHistogram()
           
 double getResourceRequestTimeMsQ10th()
           
 double getResourceRequestTimeMsQ50th()
           
 double getResourceRequestTimeMsQ99th()
           
 java.util.concurrent.ConcurrentMap<SocketDestination,ClientSocketStats> getStatsMap()
           
 double getSyncOpTimeMsAvg()
           
 double getSyncOpTimeMsQ95th()
           
 double getSyncOpTimeMsQ99th()
           
 void incrementCount(SocketDestination dest, ClientSocketStats.Tracked metric)
           
 void recordAsyncOpTimeNs(SocketDestination dest, long opTimeNs)
          Record operation for async ops time
 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 recordConnectionEstablishmentTimeUs(SocketDestination dest, long connEstTimeUs)
          Record the connection establishment time
 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
 void recordSyncOpTimeNs(SocketDestination dest, long opTimeNs)
          Record operation for sync ops time
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,
                         java.lang.String identifierString)
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
identifierString - The string of identifier

ClientSocketStats

public ClientSocketStats(java.lang.String identifierString)
Construction of a new aggregate stats object

Parameters:
identifierString - The string of identifier
Method Detail

recordSyncOpTimeNs

public void recordSyncOpTimeNs(SocketDestination dest,
                               long opTimeNs)
Record operation for sync ops time

Parameters:
dest - Destination of the socket to connect to. Will actually record if null. Otherwise will call this on self and corresponding child with this param null.
opTimeUs - The number of us for the op to finish

recordAsyncOpTimeNs

public void recordAsyncOpTimeNs(SocketDestination dest,
                                long opTimeNs)
Record operation for async ops time

Parameters:
dest - Destination of the socket to connect to. Will actually record if null. Otherwise will call this on self and corresponding child with this param null.
opTimeUs - The number of us for the op to finish

recordConnectionEstablishmentTimeUs

public void recordConnectionEstablishmentTimeUs(SocketDestination dest,
                                                long connEstTimeUs)
Record the connection establishment time

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

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.

incrementCount

public void incrementCount(SocketDestination dest,
                           ClientSocketStats.Tracked metric)

getCount

public int getCount(ClientSocketStats.Tracked metric)

getCheckoutCount

public int getCheckoutCount()

getAvgCheckoutWaitMs

public double getAvgCheckoutWaitMs()

getCheckoutTimeMsQ10th

public double getCheckoutTimeMsQ10th()

getCheckoutTimeMsQ50th

public double getCheckoutTimeMsQ50th()

getCheckoutTimeMsQ99th

public double getCheckoutTimeMsQ99th()

getCheckoutQueueLengthHistogram

public Histogram getCheckoutQueueLengthHistogram()

resourceRequestCount

public int resourceRequestCount()

getAvgResourceRequestTimeMs

public double getAvgResourceRequestTimeMs()
Returns:
0 if there have been no resourceRequest invocations

getResourceRequestTimeMsQ10th

public double getResourceRequestTimeMsQ10th()

getResourceRequestTimeMsQ50th

public double getResourceRequestTimeMsQ50th()

getResourceRequestTimeMsQ99th

public double getResourceRequestTimeMsQ99th()

getResourceRequestQueueLengthHistogram

public Histogram getResourceRequestQueueLengthHistogram()

getConnectionsActive

public int getConnectionsActive(SocketDestination destination)

getConnectionsInPool

public int getConnectionsInPool(SocketDestination destination)

getAvgConnectionEstablishmentMs

public double getAvgConnectionEstablishmentMs()

getConnectionEstablishmentQ99LatencyMs

public double getConnectionEstablishmentQ99LatencyMs()

getSyncOpTimeMsAvg

public double getSyncOpTimeMsAvg()

getSyncOpTimeMsQ95th

public double getSyncOpTimeMsQ95th()

getSyncOpTimeMsQ99th

public double getSyncOpTimeMsQ99th()

getAsyncOpTimeMsAvg

public double getAsyncOpTimeMsAvg()

getAsyncOpTimeMsQ95th

public double getAsyncOpTimeMsQ95th()

getAsyncOpTimeMsQ99th

public double getAsyncOpTimeMsQ99th()

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