[jbosscache-commits] JBoss Cache SVN: r6722 - core/trunk/src/test/java/org/jboss/cache/profiling.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Sep 15 07:23:56 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-09-15 07:23:55 -0400 (Mon, 15 Sep 2008)
New Revision: 6722

Modified:
   core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
   core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
Log:
Updates

Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java	2008-09-15 09:49:51 UTC (rev 6721)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java	2008-09-15 11:23:55 UTC (rev 6722)
@@ -2,6 +2,7 @@
 
 import org.jboss.cache.config.BuddyReplicationConfig;
 import org.jboss.cache.config.Configuration;
+import org.jboss.cache.lock.IsolationLevel;
 import org.jboss.cache.transaction.DummyTransactionManagerLookup;
 import org.testng.annotations.Test;
 
@@ -23,13 +24,19 @@
 
    public void testReplSync() throws Exception
    {
+      cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
+      cache.getConfiguration().setExposeManagementStatistics(true);
       cache.start();
       waitForTest();
    }
 
    public void testReplAsync() throws Exception
    {
+      cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
       cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
+      cache.getConfiguration().setConcurrencyLevel(500);
+      cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+//      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
       cache.start();
       waitForTest();
    }
@@ -64,6 +71,10 @@
       BuddyReplicationConfig brc = new BuddyReplicationConfig();
       brc.setEnabled(true);
       cache.getConfiguration().setBuddyReplicationConfig(brc);
+      cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
+      cache.getConfiguration().setConcurrencyLevel(500);
+      cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+//      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);      
       testReplAsync();
    }
 

Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java	2008-09-15 09:49:51 UTC (rev 6721)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java	2008-09-15 11:23:55 UTC (rev 6722)
@@ -5,6 +5,7 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.config.BuddyReplicationConfig;
 import org.jboss.cache.config.Configuration;
+import org.jboss.cache.lock.IsolationLevel;
 import org.jboss.cache.transaction.DummyTransactionManagerLookup;
 import org.jboss.cache.util.TestingUtil;
 import org.testng.annotations.Test;
@@ -36,12 +37,13 @@
    /*
       Test configuration options
     */
-   protected static final long DURATION = 5 * 60 * 1000; // 15 mins
+   protected static final long DURATION = 60 * 1000; // 1 min of GENERATION = a lot of processing.  :-)
    protected static final int NUM_THREADS = 15;
-   protected static final int MAX_RANDOM_SLEEP_MILLIS = 25;
+   protected static final int MAX_RANDOM_SLEEP_MILLIS = 1;
    protected static final int MAX_DEPTH = 3;
    protected static final int MAX_OVERALL_NODES = 200;
    protected static final int WARMUP_LOOPS = 20000;
+   protected static final boolean USE_SLEEP = false; // throttle generation a bit
 
    private List<Fqn> fqns = new ArrayList<Fqn>(MAX_OVERALL_NODES);
    private Random r = new Random();
@@ -51,6 +53,10 @@
    public void testLocalModePess() throws Exception
    {
       cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
+      cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
+      cache.getConfiguration().setConcurrencyLevel(500);
+//      cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
       runCompleteTest();
    }
 
@@ -63,12 +69,17 @@
 
    public void testReplSync() throws Exception
    {
+      cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
       runCompleteTest();
    }
 
    public void testReplAsync() throws Exception
    {
+      cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
       cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
+      cache.getConfiguration().setConcurrencyLevel(500);
+      cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+//      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
       runCompleteTest();
    }
 
@@ -100,6 +111,10 @@
       BuddyReplicationConfig brc = new BuddyReplicationConfig();
       brc.setEnabled(true);
       cache.getConfiguration().setBuddyReplicationConfig(brc);
+      cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
+      cache.getConfiguration().setConcurrencyLevel(500);
+      cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+//      cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
       testReplAsync();
    }
 
@@ -214,7 +229,9 @@
 
       long duration = System.currentTimeMillis() - startTime;
       log.warn("Finished warmup.  " + printDuration(duration));
-      cache.removeNode(Fqn.ROOT);
+      //cache.removeNode(Fqn.ROOT);
+      cache.stop();
+      cache.start();
    }
 
    private void doTest() throws Exception
@@ -240,12 +257,13 @@
                break;
          }
          exec.execute(r);
-         TestingUtil.sleepRandom(MAX_RANDOM_SLEEP_MILLIS);
+//         if (USE_SLEEP) TestingUtil.sleepRandom(MAX_RANDOM_SLEEP_MILLIS);
+         if (USE_SLEEP) TestingUtil.sleepThread(MAX_RANDOM_SLEEP_MILLIS);
       }
       log.warn("Finished generating runnables; awaiting executor completion");
       // wait for executors to complete!
       exec.shutdown();
-      exec.awaitTermination(((long) i) * 250, TimeUnit.MILLISECONDS);  // wait up to 250 millis for each call?
+      exec.awaitTermination(((long) i), TimeUnit.SECONDS);  // wait up to 1 sec for each call?
       long duration = System.currentTimeMillis() - startTime;
       log.warn("Finished test.  " + printDuration(duration));
    }




More information about the jbosscache-commits mailing list