jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1421168 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/mk/wrapper/TimingWrapper.java
Date Thu, 13 Dec 2012 09:37:42 GMT
Author: meteatamel
Date: Thu Dec 13 09:37:41 2012
New Revision: 1421168

URL: http://svn.apache.org/viewvc?rev=1421168&view=rev
Log:
Minor update to print total time as the timing progresses.

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/mk/wrapper/TimingWrapper.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/mk/wrapper/TimingWrapper.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/mk/wrapper/TimingWrapper.java?rev=1421168&r1=1421167&r2=1421168&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/mk/wrapper/TimingWrapper.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/old/mk/wrapper/TimingWrapper.java
Thu Dec 13 09:37:41 2012
@@ -37,6 +37,7 @@ public class TimingWrapper implements Mi
     private final MicroKernel mk;
     private final int id = NEXT_ID.getAndIncrement();
 
+    private long startTime;
     private final Map<String, Count> counts = new HashMap<String, Count>();
     private long lastLogTime;
 
@@ -334,6 +335,9 @@ public class TimingWrapper implements Mi
     }
 
     private void updateAndLogTimes(String operation, long start) {
+        if (startTime == 0) {
+            startTime = System.currentTimeMillis();
+        }
         counts.get(operation).update(System.currentTimeMillis() - start);
         long now = System.currentTimeMillis();
         if (now - lastLogTime >= 2000) {
@@ -346,6 +350,7 @@ public class TimingWrapper implements Mi
                     log(count.getKey() + " --> count:" + c + " max: " + max + " total:
" + total);
                 }
             }
+            System.out.println("Time: " + ((now - startTime) / 1000L));
             System.out.println("------");
         }
     }



Mime
View raw message