chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r773124 - in /hadoop/chukwa/trunk: CHANGES.txt src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java
Date Fri, 08 May 2009 22:23:02 GMT
Author: asrabkin
Date: Fri May  8 22:23:01 2009
New Revision: 773124

URL: http://svn.apache.org/viewvc?rev=773124&view=rev
Log:
CHUKWA-222. Reduce Sar version dependency. 


Modified:
    hadoop/chukwa/trunk/CHANGES.txt
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java

Modified: hadoop/chukwa/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/CHANGES.txt?rev=773124&r1=773123&r2=773124&view=diff
==============================================================================
--- hadoop/chukwa/trunk/CHANGES.txt (original)
+++ hadoop/chukwa/trunk/CHANGES.txt Fri May  8 22:23:01 2009
@@ -117,6 +117,8 @@
 
   BUG FIXES
 
+    CHUKWA-222. Reduce Sar version dependency. (Ari Rabkin) 
+
     CHUKWA-103. Fix documentation broken link. (Eric Yang)
 
     CHUKWA-208. Skip copying of test/sample directory if it doesn't exist. (Eric Yang)

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java?rev=773124&r1=773123&r2=773124&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java
(original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java
Fri May  8 22:23:01 2009
@@ -128,7 +128,13 @@
             log.debug("Data Length: " + data.length);
             while (j < data.length) {
               log.debug("header:" + headers[j] + " data:" + data[j]);
-              if (!headers[j].equals("Average:")) {
+              
+                //special case code to work around peculiar versions of Sar
+              if(headers[j].equals("rxkB/s")) {
+                record.add("rxbyt/s", Double.toString(Double.parseDouble(data[j]) * 1000));
+              } else if(headers[j].equals("txkB/s")){
+                record.add("txbyt/s", Double.toString(Double.parseDouble(data[j]) * 1000));
+              } else if (!headers[j].equals("Average:")) { //common case
                 record.add(headers[j], data[j]);
               }
               j++;



Mime
View raw message