org.apache.hadoop.hbase.ipc
Class HBaseRpcMetrics

java.lang.Object
  extended by org.apache.hadoop.hbase.ipc.HBaseRpcMetrics
All Implemented Interfaces:
org.apache.hadoop.metrics.Updater

public class HBaseRpcMetrics
extends Object
implements org.apache.hadoop.metrics.Updater

This class is for maintaining the various RPC statistics and publishing them through the metrics interfaces. This also registers the JMX MBean for RPC.

This class has a number of metrics variables that are publicly accessible; these variables (objects) have methods to update their values; for example:

rpcQueueTime.inc(time)


Field Summary
static String NAME_DELIM
           
 org.apache.hadoop.metrics.util.MetricsRegistry registry
          The metrics variables are public: - they can be set directly by calling their set/inc methods -they can also be read directly - e.g.
 org.apache.hadoop.metrics.util.MetricsTimeVaryingRate rpcProcessingTime
           
 org.apache.hadoop.metrics.util.MetricsTimeVaryingRate rpcQueueTime
           
 
Constructor Summary
HBaseRpcMetrics(String hostName, String port)
           
 
Method Summary
 void createMetrics(Class<?>[] ifaces)
          Generate metrics entries for all the methods defined in the list of interfaces.
 void createMetrics(Class<?>[] ifaces, boolean prefixWithClass)
          Generate metrics entries for all the methods defined in the list of interfaces.
 void doUpdates(org.apache.hadoop.metrics.MetricsContext context)
          Push the metrics to the monitoring subsystem on doUpdate() call.
static String getMetricName(Class<?> c, String method)
           
 void inc(String name, int amt)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME_DELIM

public static final String NAME_DELIM
See Also:
Constant Field Values

registry

public final org.apache.hadoop.metrics.util.MetricsRegistry registry
The metrics variables are public: - they can be set directly by calling their set/inc methods -they can also be read directly - e.g. JMX does this.


rpcQueueTime

public org.apache.hadoop.metrics.util.MetricsTimeVaryingRate rpcQueueTime

rpcProcessingTime

public org.apache.hadoop.metrics.util.MetricsTimeVaryingRate rpcProcessingTime
Constructor Detail

HBaseRpcMetrics

public HBaseRpcMetrics(String hostName,
                       String port)
Method Detail

inc

public void inc(String name,
                int amt)

createMetrics

public void createMetrics(Class<?>[] ifaces)
Generate metrics entries for all the methods defined in the list of interfaces. A MetricsTimeVaryingRate counter will be created for each Class.getMethods().getName() entry.

Parameters:
ifaces - Define metrics for all methods in the given classes

createMetrics

public void createMetrics(Class<?>[] ifaces,
                          boolean prefixWithClass)
Generate metrics entries for all the methods defined in the list of interfaces. A MetricsTimeVaryingRate counter will be created for each Class.getMethods().getName() entry.

If prefixWithClass is true, each metric will be named as [Class.getSimpleName()].[Method.getName()]. Otherwise each metric will just be named according to the method -- Method.getName().

Parameters:
ifaces - Define metrics for all methods in the given classes
prefixWithClass - If true, each metric will be named as "classname.method"

getMetricName

public static String getMetricName(Class<?> c,
                                   String method)

doUpdates

public void doUpdates(org.apache.hadoop.metrics.MetricsContext context)
Push the metrics to the monitoring subsystem on doUpdate() call.

Specified by:
doUpdates in interface org.apache.hadoop.metrics.Updater
Parameters:
context - ctx

shutdown

public void shutdown()


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.