From e279c17552060617604892ab4b4377ae3c935c30 Mon Sep 17 00:00:00 2001 From: Elliott Clark Date: Thu, 13 Jun 2013 10:54:53 -0700 Subject: [PATCH] First cut a developer metrics --- src/main/docbkx/developer.xml | 42 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git src/main/docbkx/developer.xml src/main/docbkx/developer.xml index c990235..abbbbca 100644 --- src/main/docbkx/developer.xml +++ src/main/docbkx/developer.xml @@ -145,7 +145,7 @@ Access restriction: The method getLong(Object, long) from the type Unsafe is not -
+
Building Apache HBase
Basic Compile @@ -208,7 +208,7 @@ $ MAVEN_OPTS="-Xmx2g" mvn clean install deploy -DskipTests -Dhadoop.profile=2.0
-
+
Adding an Apache HBase release to Apache's Maven Repository Follow the instructions at Publishing Maven Artifacts after @@ -343,7 +343,7 @@ What is the new development version for "HBase"? (org.apache.hbase:hbase) 0.92.3 [INFO] -----------------------------------------------------------------------
-
+
Generating the HBase Reference Guide The manual is marked up using docbook. We then use the docbkx maven plugin @@ -1011,6 +1011,42 @@ mvn compile is just a good thing to try running first, if maven is acting oddly.
+
+ Adding Metrics + + After adding a new feature a developer might want to add metrics. HBase exposes + metrics using the Hadoop Metrics 2 system, so adding a new metric involves + exposing that metric to the hadoop system. Unfortunately the API of metrics2 + changed from hadoop 1 to hadoop 2. In order to get around this a set of + interfaces and implementations have to be loaded at runtime. To get an in-depth + look at the reasoning and structure of these classes you can read the blog post + located here. + To add a metric to an existing MBean follow the short guide below: + +
+ Add Metric name and Function to Hadoop Compat Interface. + + Inside of the source interface the corresponds to where the metrics are + generated (eg MetricsMasterSource for things coming from HMaster) create new + static strings for metric name and description. Then add a new method that + will be called to add new reading. + +
+
+ Add the Implementation to Both Hadoop 1 and Hadoop 2 Compat modules. + + Inside of the implementation of the source (eg. MetricsMasterSourceImpl + in the above example) create a new histogram, counter, gauge, or stat in the + init method. Then in the method that was added to the interface wire up the + parameter passed in to the histogram. + + + Now add tests that make sure the data is correctly exported to the metrics 2 + system. For this the MetricsAssertHelper is provided. + +
+
+
-- 1.7.10.2 (Apple Git-33)