jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1241506 - in /jackrabbit/sandbox/microkernel/src: main/java/org/apache/jackrabbit/mk/mem/ test/java/org/apache/jackrabbit/mk/ test/java/org/apache/jackrabbit/mk/large/ test/java/org/apache/jackrabbit/mk/util/
Date Tue, 07 Feb 2012 16:12:59 GMT
Author: thomasm
Date: Tue Feb  7 16:12:59 2012
New Revision: 1241506

URL: http://svn.apache.org/viewvc?rev=1241506&view=rev
Log:
Simplify running a 1 million nodes test / 20 million nodes test

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/NodeCreator.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java?rev=1241506&r1=1241505&r2=1241506&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/mem/MemoryKernelImpl.java
Tue Feb  7 16:12:59 2012
@@ -596,4 +596,8 @@ public class MemoryKernelImpl extends Wr
         }
     }
 
+    public String toString() {
+        return "simple:" + name;
+    }
+
 }

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java?rev=1241506&r1=1241505&r2=1241506&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/MultiMkTestBase.java
Tue Feb  7 16:12:59 2012
@@ -47,10 +47,10 @@ public class MultiMkTestBase {
     @Parameters
     public static Collection<Object[]> urls() {
             return Arrays.asList(new Object[][]{
-                    {"fs:{homeDir}/target"},
-                    {"simple:"},
                     {"simple:fs:target/temp"},
-                    {"http-bridge:fs:{homeDir}/target"}
+                    {"fs:{homeDir}/target"},
+                    {"http-bridge:fs:{homeDir}/target"},
+                    {"simple:"}
                     });
     }
 

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java?rev=1241506&r1=1241505&r2=1241506&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/large/CreateNodesTraverseTest.java
Tue Feb  7 16:12:59 2012
@@ -27,10 +27,6 @@ public class CreateNodesTraverseTest ext
 
     // -Xmx512m -Dmk.fastDb=true
 
-    private int totalCount = 200;
-
-    // private int totalCount = 2000000;
-
     public CreateNodesTraverseTest(String url) {
         super(url);
     }
@@ -38,7 +34,15 @@ public class CreateNodesTraverseTest ext
     @Test
     public void test() throws Exception {
         NodeCreator c = new NodeCreator(mk);
-        c.setTotalCount(totalCount);
+        c.setTotalCount(200);
+
+        // 1 million node test
+        // c.setLogToSystemOut(true);
+        // c.setTotalCount(1000000);
+
+        // 20 million node test
+        // c.setTotalCount(20000000);
+
         c.create();
         c.traverse();
     }

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/NodeCreator.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/NodeCreator.java?rev=1241506&r1=1241505&r2=1241506&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/NodeCreator.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/util/NodeCreator.java
Tue Feb  7 16:12:59 2012
@@ -30,6 +30,7 @@ public class NodeCreator {
     private StopWatch timer;
     private String nodeName = "test";
     private String data = "Hello World";
+    private boolean logToSystemOut;
 
     public NodeCreator(MicroKernel mk) {
         this.mk = mk;
@@ -53,6 +54,8 @@ public class NodeCreator {
     }
 
     public void create() {
+        log("implementation: " + mk);
+        log("creating " + totalCount + " nodes");
         head = mk.commit("/", "+\"" + nodeName + "\":{}", head, "");
         timer = new StopWatch();
         count = 0;
@@ -60,6 +63,7 @@ public class NodeCreator {
         log("depth: " + depth);
         createNodes(nodeName, depth);
         log("created  " + count + " nodes in " + timer.operationsPerSecond(count));
+        log("");
     }
 
     public void traverse() {
@@ -125,7 +129,13 @@ public class NodeCreator {
     }
 
     private void log(String s) {
-        // System.out.println(s);
+        if (logToSystemOut) {
+            System.out.println(s);
+        }
+    }
+
+    public void setLogToSystemOut(boolean logToSystemOut) {
+        this.logToSystemOut = logToSystemOut;
     }
 
 }



Mime
View raw message