jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1528750 - /jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/
Date Thu, 03 Oct 2013 08:48:37 GMT
Author: thomasm
Date: Thu Oct  3 08:48:36 2013
New Revision: 1528750

URL: http://svn.apache.org/r1528750
Log:
OAK-1074 Benchmarks: use different test root nodes each time

Modified:
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateManyChildNodesTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateNodesBenchmark.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetDeepNodeTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetNodeTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadManyTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SimpleSearchTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileReadTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileWriteTest.java
    jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/UpdateManyChildNodesTest.java

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractDeepTreeTest.java
Thu Oct  3 08:48:36 2013
@@ -51,7 +51,7 @@ public abstract class AbstractDeepTreeTe
     @Override
     protected void beforeSuite() throws Exception {
         adminSession = getRepository().login(getCredentials());
-        String name = getClass().getSimpleName();
+        String name = getClass().getSimpleName() + TEST_ID;
         Node rn = adminSession.getRootNode();
 
         long start = System.currentTimeMillis();

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/AbstractTest.java
Thu Oct  3 08:48:36 2013
@@ -18,6 +18,7 @@ package org.apache.jackrabbit.oak.benchm
 
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Random;
 import java.util.concurrent.TimeUnit;
 
 import javax.jcr.Credentials;
@@ -36,6 +37,15 @@ import org.apache.jackrabbit.oak.fixture
  */
 abstract class AbstractTest extends Benchmark {
 
+    /**
+     * A random string to guarantee concurrently running tests don't overwrite
+     * each others changes (for example in a cluster).
+     * <p>
+     * The probability of duplicates, for 50 concurrent processes, is less than
+     * 1 in 1 million.
+     */
+    static final String TEST_ID = Integer.toHexString(new Random().nextInt());
+    
     private static final Credentials CREDENTIALS = new SimpleCredentials("admin", "admin".toCharArray());
 
     private static final long WARMUP = TimeUnit.SECONDS.toMillis(Long.getLong("warmup", 5));
@@ -43,7 +53,7 @@ abstract class AbstractTest extends Benc
     private static final long RUNTIME = TimeUnit.SECONDS.toMillis(Long.getLong("runtime",
60));
     
     private static final boolean PROFILE = Boolean.getBoolean("profile");
-
+    
     private Repository repository;
 
     private Credentials credentials;

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/BenchmarkRunner.java
Thu Oct  3 08:48:36 2013
@@ -77,6 +77,8 @@ public class BenchmarkRunner {
                         host.value(options), port.value(options),
                         dbName.value(options), dropDBAfterTest.value(options),
                         cacheSize * MB),
+                        OakRepositoryFixture.getMongoLog(
+                                host.value(options), port.value(options), cacheSize * MB),
                 OakRepositoryFixture.getSegment(
                         host.value(options), port.value(options), cacheSize * MB),
                 OakRepositoryFixture.getTar(

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ConcurrentReadTest.java
Thu Oct  3 08:48:36 2013
@@ -30,6 +30,8 @@ import javax.jcr.Session;
 public class ConcurrentReadTest extends AbstractTest {
 
     protected static final int NODE_COUNT = 100;
+    
+    protected static final String ROOT_NODE_NAME = "test" + TEST_ID;
 
     private final int backgroundReaderCount;
 
@@ -54,7 +56,7 @@ public class ConcurrentReadTest extends 
     @Override
     public void beforeSuite() throws Exception {
         Session session = loginWriter();
-        Node root = session.getRootNode().addNode("testroot", "nt:unstructured");
+        Node root = session.getRootNode().addNode(ROOT_NODE_NAME, "nt:unstructured");
         for (int i = 0; i < NODE_COUNT; i++) {
             Node node = root.addNode("node" + i, "nt:unstructured");
             for (int j = 0; j < NODE_COUNT; j++) {
@@ -89,7 +91,7 @@ public class ConcurrentReadTest extends 
                 for (int i = 0; i < 10000; i++) {
                     int a = random.nextInt(NODE_COUNT);
                     int b = random.nextInt(NODE_COUNT);
-                    session.getRootNode().getNode("testroot/node" + a + "/node" + b);
+                    session.getRootNode().getNode(ROOT_NODE_NAME + "/node" + a + "/node"
+ b);
                 }
             } catch (RepositoryException e) {
                 throw new RuntimeException(e);
@@ -113,7 +115,7 @@ public class ConcurrentReadTest extends 
                     int a = random.nextInt(NODE_COUNT);
                     int b = random.nextInt(NODE_COUNT);
                     Node node = session.getRootNode().getNode(
-                            "testroot/node" + a + "/node" + b);
+                            ROOT_NODE_NAME + "/node" + a + "/node" + b);
                     boolean done = false;
                     while (!done) {
                         try {
@@ -141,7 +143,7 @@ public class ConcurrentReadTest extends 
     @Override
     public void afterSuite() throws Exception {
         Session session = loginWriter();
-        Node root = session.getRootNode().getNode("testroot");
+        Node root = session.getRootNode().getNode(ROOT_NODE_NAME);
         for (int i = 0; i < NODE_COUNT; i++) {
             root.getNode("node" + i).remove();
             session.save();

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateManyChildNodesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateManyChildNodesTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateManyChildNodesTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateManyChildNodesTest.java
Thu Oct  3 08:48:36 2013
@@ -25,6 +25,8 @@ import javax.jcr.Session;
  * {@value #CHILD_COUNT} child nodes.
  */
 public class CreateManyChildNodesTest extends AbstractTest {
+    
+    protected static final String ROOT_NODE_NAME = "test" + TEST_ID;
 
     private static final int CHILD_COUNT = 10 * 1000;
 
@@ -41,7 +43,7 @@ public class CreateManyChildNodesTest ex
 
     @Override
     public void runTest() throws Exception {
-        Node node = session.getRootNode().addNode("testnode", "nt:unstructured");
+        Node node = session.getRootNode().addNode(ROOT_NODE_NAME, "nt:unstructured");
         for (int i = 0; i < CHILD_COUNT; i++) {
             node.addNode("node" + i, "nt:unstructured");
         }
@@ -50,7 +52,7 @@ public class CreateManyChildNodesTest ex
 
     @Override
     public void afterTest() throws RepositoryException {
-        session.getRootNode().getNode("testnode").remove();
+        session.getRootNode().getNode(ROOT_NODE_NAME).remove();
         session.save();
     }
 

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateNodesBenchmark.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateNodesBenchmark.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateNodesBenchmark.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/CreateNodesBenchmark.java
Thu Oct  3 08:48:36 2013
@@ -57,7 +57,8 @@ public class CreateNodesBenchmark extend
                 new SimpleCredentials("admin", "admin".toCharArray()));
         AtomicInteger count = new AtomicInteger();
         long time = System.currentTimeMillis();
-        createNodes(session.getRootNode(), 10, 5, count);
+        Node testRoot = session.getRootNode().addNode("r" + AbstractTest.TEST_ID);
+        createNodes(testRoot, 10, 5, count);
         time = System.currentTimeMillis() - time;
         System.out.format(
                 "Created %d nodes in %d seconds (%.2fms/node)%n",

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetDeepNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetDeepNodeTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetDeepNodeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetDeepNodeTest.java
Thu Oct  3 08:48:36 2013
@@ -35,7 +35,8 @@ public class GetDeepNodeTest extends Abs
     @Override
     protected void beforeSuite() throws Exception {
         session = loginWriter();
-        testRoot = session.getRootNode().addNode(GetNodeTest.class.getSimpleName(), "nt:unstructured");
+        testRoot = session.getRootNode().addNode(
+                getClass().getSimpleName() + TEST_ID, "nt:unstructured");
         Node node = testRoot;
         testPath = "";
         for (int k = 0; k < DEPTH; k++) {

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetNodeTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetNodeTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetNodeTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/GetNodeTest.java
Thu Oct  3 08:48:36 2013
@@ -68,7 +68,8 @@ public abstract class GetNodeTest extend
     @Override
     protected void beforeSuite() throws Exception {
         Session session = loginWriter();
-        testRoot = session.getRootNode().addNode(GetNodeTest.class.getSimpleName(), "nt:unstructured");
+        testRoot = session.getRootNode().addNode(
+                getClass().getSimpleName() + TEST_ID, "nt:unstructured");
         testRoot.addNode("node1").addNode("node2");
 
         addAccessControlEntry(session, testRoot.getPath(), EveryonePrincipal.getInstance(),

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadManyTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadManyTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadManyTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/ReadManyTest.java
Thu Oct  3 08:48:36 2013
@@ -150,7 +150,7 @@ abstract class ReadManyTest extends Abst
     @Override
     protected void beforeSuite() throws Exception {
         session = getRepository().login(getCredentials());
-        root = session.getRootNode().addNode("content");
+        root = session.getRootNode().addNode("c" + TEST_ID);
         for (int i = 0; i < scale; i++) {
             Node top = root.addNode("node" + i);
             for (int j = 0; j < 1000; j++) {

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SimpleSearchTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SimpleSearchTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SimpleSearchTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SimpleSearchTest.java
Thu Oct  3 08:48:36 2013
@@ -47,7 +47,7 @@ public class SimpleSearchTest extends Ab
     public void beforeSuite() throws RepositoryException {
         session = getRepository().login(getCredentials());
 
-        root = session.getRootNode().addNode("testroot", "nt:unstructured");
+        root = session.getRootNode().addNode("testroot" + TEST_ID, "nt:unstructured");
         for (int i = 0; i < NODE_COUNT; i++) {
             Node node = root.addNode("node" + i, "nt:unstructured");
             for (int j = 0; j < NODE_COUNT; j++) {

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileReadTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileReadTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileReadTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileReadTest.java
Thu Oct  3 08:48:36 2013
@@ -41,7 +41,7 @@ public class SmallFileReadTest extends A
         session = getRepository().login(getCredentials());
 
         root = session.getRootNode().addNode(
-                "SmallFileReadTest", "nt:folder");
+                getClass().getSimpleName() + TEST_ID, "nt:folder");
         for (int i = 0; i < FILE_COUNT; i++) {
             Node file = root.addNode("file" + i, "nt:file");
             Node content = file.addNode("jcr:content", "nt:resource");

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileWriteTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileWriteTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileWriteTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SmallFileWriteTest.java
Thu Oct  3 08:48:36 2013
@@ -45,7 +45,7 @@ public class SmallFileWriteTest extends 
     @Override
     public void beforeTest() throws RepositoryException {
         root = session.getRootNode().addNode(
-                "SmallFileWriteTest" + iteration++, "nt:folder");
+                "SmallFileWrite" + TEST_ID + iteration++, "nt:folder");
         session.save();
     }
 

Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/UpdateManyChildNodesTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/UpdateManyChildNodesTest.java?rev=1528750&r1=1528749&r2=1528750&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/UpdateManyChildNodesTest.java
(original)
+++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/UpdateManyChildNodesTest.java
Thu Oct  3 08:48:36 2013
@@ -25,6 +25,8 @@ import javax.jcr.Session;
  * node with {@value #CHILD_COUNT} existing child nodes.
  */
 public class UpdateManyChildNodesTest extends AbstractTest {
+    
+    protected static final String ROOT_NODE_NAME = "update" + TEST_ID;
 
     private static final int CHILD_COUNT = 10 * 1000;
 
@@ -35,7 +37,7 @@ public class UpdateManyChildNodesTest ex
     @Override
     public void beforeSuite() throws RepositoryException {
         session = getRepository().login(getCredentials());
-        node = session.getRootNode().addNode("testnode", "nt:unstructured");
+        node = session.getRootNode().addNode(ROOT_NODE_NAME, "nt:unstructured");
         for (int i = 0; i < CHILD_COUNT; i++) {
             node.addNode("node" + i, "nt:unstructured");
         }
@@ -59,7 +61,7 @@ public class UpdateManyChildNodesTest ex
 
     @Override
     public void afterSuite() throws RepositoryException {
-        session.getRootNode().getNode("testnode").remove();
+        session.getRootNode().getNode(ROOT_NODE_NAME).remove();
         session.save();
         session.logout();
     }



Mime
View raw message