flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hshreedha...@apache.org
Subject svn commit: r1363898 - /flume/trunk/flume-ng-core/src/main/java/org/apache/flume/instrumentation/GangliaServer.java
Date Fri, 20 Jul 2012 18:58:49 GMT
Author: hshreedharan
Date: Fri Jul 20 18:58:49 2012
New Revision: 1363898

URL: http://svn.apache.org/viewvc?rev=1363898&view=rev
Log:
FLUME-1386. Ganglia metrics plugin should filter MBean name.

(Mubarak Seyed via Hari Shreedharan)

Modified:
    flume/trunk/flume-ng-core/src/main/java/org/apache/flume/instrumentation/GangliaServer.java

Modified: flume/trunk/flume-ng-core/src/main/java/org/apache/flume/instrumentation/GangliaServer.java
URL: http://svn.apache.org/viewvc/flume/trunk/flume-ng-core/src/main/java/org/apache/flume/instrumentation/GangliaServer.java?rev=1363898&r1=1363897&r2=1363898&view=diff
==============================================================================
--- flume/trunk/flume-ng-core/src/main/java/org/apache/flume/instrumentation/GangliaServer.java
(original)
+++ flume/trunk/flume-ng-core/src/main/java/org/apache/flume/instrumentation/GangliaServer.java
Fri Jul 20 18:58:49 2012
@@ -93,6 +93,7 @@ public class GangliaServer implements Mo
   public final int DEFAULT_POLL_FREQUENCY = 60;
   public final String CONF_HOSTS = "hosts";
   public final String CONF_ISGANGLIA3 = "isGanglia3";
+  private static final String GANGLIA_CONTEXT = "flume.";
 
   /**
    *
@@ -350,14 +351,16 @@ public class GangliaServer implements Mo
           }
           AttributeList attrList = mbeanServer.getAttributes(
                   obj.getObjectName(), strAtts);
+          String component = obj.getObjectName().toString().substring(
+              obj.getObjectName().toString().indexOf('=') + 1);
           for (Object attr : attrList) {
             Attribute localAttr = (Attribute) attr;
             if (isGanglia3) {
-              server.createGangliaMessage(obj.getObjectName() + "."
+              server.createGangliaMessage(GANGLIA_CONTEXT + component + "."
                       + localAttr.getName(),
                       localAttr.getValue().toString());
             } else {
-              server.createGangliaMessage31(obj.getObjectName() + "."
+              server.createGangliaMessage31(GANGLIA_CONTEXT + component + "."
                       + localAttr.getName(),
                       localAttr.getValue().toString());
             }



Mime
View raw message