chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asrab...@apache.org
Subject svn commit: r773125 - in /hadoop/chukwa/branches/chukwa-0.1: CHANGES.txt src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java
Date Fri, 08 May 2009 22:25:33 GMT
Author: asrabkin
Date: Fri May  8 22:25:33 2009
New Revision: 773125

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

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

Modified: hadoop/chukwa/branches/chukwa-0.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/chukwa/branches/chukwa-0.1/CHANGES.txt?rev=773125&r1=773124&r2=773125&view=diff
==============================================================================
--- hadoop/chukwa/branches/chukwa-0.1/CHANGES.txt (original)
+++ hadoop/chukwa/branches/chukwa-0.1/CHANGES.txt Fri May  8 22:25:33 2009
@@ -111,6 +111,8 @@
 
   BUG FIXES
 
+    CHUKWA-222. Reduce Sar version dependency. (Ari Rabkin)
+
     CHUKWA-208. Skip copying of test/sample directory if it doesn't exist. (Eric Yang)
 
     CHUKWA-206. Removed hard coded path from configuration files, and sample data. (Eric
Yang)

Modified: hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java?rev=773125&r1=773124&r2=773125&view=diff
==============================================================================
--- hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java
(original)
+++ hadoop/chukwa/branches/chukwa-0.1/src/java/org/apache/hadoop/chukwa/extraction/demux/processor/mapper/Sar.java
Fri May  8 22:25:33 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