org.apache.hadoop.hbase.client
Class MetricsConnection

java.lang.Object
  extended by org.apache.hadoop.hbase.client.MetricsConnection

@InterfaceAudience.Private
public class MetricsConnection
extends Object

This class is for maintaining the various connection statistics and publishing them through the metrics interfaces. This class manages its own MetricsRegistry and JmxReporter so as to not conflict with other uses of Yammer Metrics within the client application. Instantiating this class implicitly creates and "starts" instances of these classes; be sure to call shutdown() to terminate the thread pools they allocate.


Nested Class Summary
static class MetricsConnection.CallStats
          A container class for collecting details about the RPC call as it percolates.
protected  class MetricsConnection.CallTracker
           
protected static class MetricsConnection.RegionStats
           
protected static class MetricsConnection.RunnerStats
           
 
Field Summary
protected  MetricsConnection.CallTracker appendTracker
           
static String CLIENT_SIDE_METRICS_ENABLED_KEY
          Set this key to true to enable metrics collection of client requests.
protected  MetricsConnection.CallTracker deleteTracker
           
protected  MetricsConnection.CallTracker getTracker
           
protected  MetricsConnection.CallTracker incrementTracker
           
protected  com.yammer.metrics.core.Counter metaCacheHits
           
protected  com.yammer.metrics.core.Counter metaCacheMisses
           
protected  MetricsConnection.CallTracker multiTracker
           
protected  MetricsConnection.CallTracker putTracker
           
protected  ConcurrentMap<String,com.yammer.metrics.core.Histogram> rpcHistograms
           
protected  ConcurrentMap<String,com.yammer.metrics.core.Timer> rpcTimers
           
protected  MetricsConnection.RunnerStats runnerStats
           
protected  MetricsConnection.CallTracker scanTracker
           
protected  ConcurrentHashMap<ServerName,ConcurrentMap<byte[],MetricsConnection.RegionStats>> serverStats
           
 
Constructor Summary
MetricsConnection(HConnectionManager.HConnectionImplementation conn)
           
 
Method Summary
 void incrDelayRunners()
          Increment the number of delay runner counts.
 void incrMetaCacheHit()
          Increment the number of meta cache hits.
 void incrMetaCacheMiss()
          Increment the number of meta cache misses.
 void incrNormalRunners()
          Increment the number of normal runner counts.
static MetricsConnection.CallStats newCallStats()
          Produce an instance of MetricsConnection.CallStats for clients to attach to RPCs.
 void shutdown()
           
 void updateDelayInterval(long interval)
          Update delay interval of delay runner.
 void updateRpc(com.google.protobuf.Descriptors.MethodDescriptor method, com.google.protobuf.Message param, MetricsConnection.CallStats stats)
          Report RPC context to metrics system.
 void updateServerStats(ServerName serverName, byte[] regionName, Object r)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIENT_SIDE_METRICS_ENABLED_KEY

public static final String CLIENT_SIDE_METRICS_ENABLED_KEY
Set this key to true to enable metrics collection of client requests.

See Also:
Constant Field Values

serverStats

protected ConcurrentHashMap<ServerName,ConcurrentMap<byte[],MetricsConnection.RegionStats>> serverStats

metaCacheHits

protected final com.yammer.metrics.core.Counter metaCacheHits

metaCacheMisses

protected final com.yammer.metrics.core.Counter metaCacheMisses

getTracker

protected final MetricsConnection.CallTracker getTracker

scanTracker

protected final MetricsConnection.CallTracker scanTracker

appendTracker

protected final MetricsConnection.CallTracker appendTracker

deleteTracker

protected final MetricsConnection.CallTracker deleteTracker

incrementTracker

protected final MetricsConnection.CallTracker incrementTracker

putTracker

protected final MetricsConnection.CallTracker putTracker

multiTracker

protected final MetricsConnection.CallTracker multiTracker

runnerStats

protected final MetricsConnection.RunnerStats runnerStats

rpcTimers

protected final ConcurrentMap<String,com.yammer.metrics.core.Timer> rpcTimers

rpcHistograms

protected final ConcurrentMap<String,com.yammer.metrics.core.Histogram> rpcHistograms
Constructor Detail

MetricsConnection

public MetricsConnection(HConnectionManager.HConnectionImplementation conn)
Method Detail

updateServerStats

public void updateServerStats(ServerName serverName,
                              byte[] regionName,
                              Object r)

shutdown

public void shutdown()

newCallStats

public static MetricsConnection.CallStats newCallStats()
Produce an instance of MetricsConnection.CallStats for clients to attach to RPCs.


incrMetaCacheHit

public void incrMetaCacheHit()
Increment the number of meta cache hits.


incrMetaCacheMiss

public void incrMetaCacheMiss()
Increment the number of meta cache misses.


incrNormalRunners

public void incrNormalRunners()
Increment the number of normal runner counts.


incrDelayRunners

public void incrDelayRunners()
Increment the number of delay runner counts.


updateDelayInterval

public void updateDelayInterval(long interval)
Update delay interval of delay runner.


updateRpc

public void updateRpc(com.google.protobuf.Descriptors.MethodDescriptor method,
                      com.google.protobuf.Message param,
                      MetricsConnection.CallStats stats)
Report RPC context to metrics system.



Copyright © 2007-2016 The Apache Software Foundation. All Rights Reserved.