Procházet zdrojové kódy

HADOOP-1163. Fix ganglia metrics to aggregate metrics from different hosts properly. Contributed by Michael Bieniosek.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@525577 13f79535-47bb-0310-9956-ffa450edef68
Thomas White před 18 roky
rodič
revize
495ee37f0a

+ 3 - 0
CHANGES.txt

@@ -97,6 +97,9 @@ Trunk (unreleased changes)
 30. HADOOP-702.  Add tools to help automate HDFS upgrades.
     (Konstantin Shvachko via cutting)
 
+31. HADOOP-1163.  Fix ganglia metrics to aggregate metrics from different
+    hosts properly.  (Michael Bieniosek via tomwhite)
+
 
 Release 0.12.3 (not yet released)
 

+ 1 - 11
src/java/org/apache/hadoop/metrics/ganglia/GangliaContext.java

@@ -116,21 +116,11 @@ public class GangliaContext extends AbstractMetricsContext {
     public void emitRecord(String contextName, String recordName, OutputRecord outRec) 
         throws IOException
     {
-        
-        // metric name formed from record name and tag values
-        StringBuffer nameBuf = new StringBuffer(recordName);
-        for (String tagName : outRec.getTagNames()) {
-          nameBuf.append('.');
-          nameBuf.append(outRec.getTag(tagName));
-        }
-        nameBuf.append('.');
-        String namePrefix = new String(nameBuf);
-        
         // emit each metric in turn
         for (String metricName : outRec.getMetricNames()) {
           Object metric = outRec.getMetric(metricName);
           String type = (String) typeTable.get(metric.getClass());
-          emitMetric(namePrefix + metricName, type, metric.toString());
+          emitMetric(metricName, type, metric.toString());
         }
         
     }