chukwa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ey...@apache.org
Subject svn commit: r760286 - in /hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database: Aggregator.java DataExpiration.java
Date Tue, 31 Mar 2009 01:06:56 GMT
Author: eyang
Date: Tue Mar 31 01:06:55 2009
New Revision: 760286

URL: http://svn.apache.org/viewvc?rev=760286&view=rev
Log:
CHUKWA-31.  Added duration logging for SQL statements.

Modified:
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Aggregator.java
    hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Aggregator.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Aggregator.java?rev=760286&r1=760285&r2=760286&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Aggregator.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/Aggregator.java Tue Mar
31 01:06:55 2009
@@ -92,6 +92,7 @@
   }
 
   public static void main(String[] args) {
+    long aggregatorStart = Calendar.getInstance().getTimeInMillis();
     long longest = 0;
     String longQuery = null;
     log.info("Aggregator started.");
@@ -121,8 +122,10 @@
       }
     }
     db.close();
+    long aggregatorEnd = Calendar.getInstance().getTimeInMillis();
     log.info("Longest running query: " + longQuery + " (" + (double) longest
         / 1000 + " seconds)");
+    log.info("Total running time: ("+(double) (aggregatorEnd-aggregatorStart)/1000+" seconds)");
     log.info("Aggregator finished.");
   }
 

Modified: hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java
URL: http://svn.apache.org/viewvc/hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java?rev=760286&r1=760285&r2=760286&view=diff
==============================================================================
--- hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java (original)
+++ hadoop/chukwa/trunk/src/java/org/apache/hadoop/chukwa/database/DataExpiration.java Tue
Mar 31 01:06:55 2009
@@ -20,6 +20,7 @@
 
 
 import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -101,9 +102,12 @@
     if (args.length == 2) {
       SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
       try {
+        long dataExpStart = Calendar.getInstance().getTimeInMillis();
         start = sdf.parse(args[0]).getTime();
         end = start + (Long.parseLong(args[1]) * 1440 * 60 * 1000L);
         de.dropTables(start, end);
+        long dataExpEnd = Calendar.getInstance().getTimeInMillis();
+        log.info("DataExpiration for: "+args[0]+" "+args[1]+" finished: ("+(double) (dataExpEnd-dataExpStart)/1000+"
seconds)");
       } catch (Exception e) {
         usage();
       }



Mime
View raw message