jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1354408 - in /jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance: AbstractDeepTreeTest.java ConcurrentReadAccessControlledTreeTest.java ConcurrentReadDeepTreeTest.java ReadDeepTreeTest.java
Date Wed, 27 Jun 2012 10:27:34 GMT
Author: angela
Date: Wed Jun 27 10:27:33 2012
New Revision: 1354408

URL: http://svn.apache.org/viewvc?rev=1354408&view=rev
Log:
JCR-3356 : performance tests

Modified:
    jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractDeepTreeTest.java
    jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadAccessControlledTreeTest.java
    jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadDeepTreeTest.java
    jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ReadDeepTreeTest.java

Modified: jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractDeepTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractDeepTreeTest.java?rev=1354408&r1=1354407&r2=1354408&view=diff
==============================================================================
--- jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractDeepTreeTest.java
(original)
+++ jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/AbstractDeepTreeTest.java
Wed Jun 27 10:27:33 2012
@@ -76,7 +76,7 @@ public abstract class AbstractDeepTreeTe
         adminSession.logout();
     }
 
-    protected static void randomRead(Session testSession, List<String> allPaths, int
cnt) throws RepositoryException {
+    protected static void randomRead(Session testSession, List<String> allPaths, int
cnt, boolean doReport) throws RepositoryException {
         int nodeCnt = 0;
         int propertyCnt = 0;
         int noAccess = 0;
@@ -98,6 +98,8 @@ public abstract class AbstractDeepTreeTe
             }
         }
         long end = System.currentTimeMillis();
-        System.out.println("Reading " + (cnt-noAccess) + " (Nodes: "+ nodeCnt +"; Properties:
"+propertyCnt+") completed in " + (end - start));
+        if (doReport) {
+            System.out.println("Reading " + (cnt-noAccess) + " (Nodes: "+ nodeCnt +"; Properties:
"+propertyCnt+") completed in " + (end - start));
+        }
     }
 }

Modified: jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadAccessControlledTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadAccessControlledTreeTest.java?rev=1354408&r1=1354407&r2=1354408&view=diff
==============================================================================
--- jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadAccessControlledTreeTest.java
(original)
+++ jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadAccessControlledTreeTest.java
Wed Jun 27 10:27:33 2012
@@ -77,23 +77,30 @@ public class ConcurrentReadAccessControl
         visitor.visit(testRoot);
 
         for (int i = 0; i < bgReaders; i++) {
-            addBackgroundJob(new RandomRead());
+            addBackgroundJob(new RandomRead(loginReader(), false));
         }
     }
 
     @Override
     protected void runTest() throws Exception {
-        RandomRead randomRead = new RandomRead();
+        Session testSession = getRepository().login();
+        RandomRead randomRead = new RandomRead(testSession, true);
         randomRead.run();
+        testSession.logout();
     }
 
     private class RandomRead implements Runnable {
 
-        private final Session testSession = loginReader();
+        private final Session testSession;
+        private final boolean doReport;
 
+        private RandomRead(Session testSession, boolean doReport) {
+            this.testSession = testSession;
+            this.doReport = doReport;
+        }
         public void run() {
             try {
-                randomRead(testSession, allPaths, cnt);
+                randomRead(testSession, allPaths, cnt, doReport);
             } catch (RepositoryException e) {
                 throw new RuntimeException(e);
             }

Modified: jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadDeepTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadDeepTreeTest.java?rev=1354408&r1=1354407&r2=1354408&view=diff
==============================================================================
--- jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadDeepTreeTest.java
(original)
+++ jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ConcurrentReadDeepTreeTest.java
Wed Jun 27 10:27:33 2012
@@ -32,23 +32,29 @@ public class ConcurrentReadDeepTreeTest 
         super.beforeSuite();
 
         for (int i = 0; i < bgReaders; i++) {
-            addBackgroundJob(new RandomRead());
+            addBackgroundJob(new RandomRead(loginReader()));
         }
     }
 
     @Override
     protected void runTest() throws Exception {
-        RandomRead randomRead = new RandomRead();
+        Session testSession = getRepository().login();
+        RandomRead randomRead = new RandomRead(testSession);
         randomRead.run();
+        testSession.logout();
     }
 
     private class RandomRead implements Runnable {
 
-        private final Session testSession = loginReader();
+        private final Session testSession;
+
+        private RandomRead(Session testSession) {
+            this.testSession = testSession;
+        }
 
         public void run() {
             try {
-                randomRead(testSession, allPaths, cnt);
+                randomRead(testSession, allPaths, cnt, true);
             } catch (RepositoryException e) {
                 throw new RuntimeException(e);
             }

Modified: jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ReadDeepTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ReadDeepTreeTest.java?rev=1354408&r1=1354407&r2=1354408&view=diff
==============================================================================
--- jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ReadDeepTreeTest.java
(original)
+++ jackrabbit/trunk/test/performance/base/src/main/java/org/apache/jackrabbit/performance/ReadDeepTreeTest.java
Wed Jun 27 10:27:33 2012
@@ -35,7 +35,7 @@ public class ReadDeepTreeTest extends Ab
 
     @Override
     protected void runTest() throws Exception {
-        randomRead(testSession, allPaths, cnt);
+        randomRead(testSession, allPaths, cnt, true);
     }
 
     @Override



Mime
View raw message