[jbosscache-commits] JBoss Cache SVN: r6733 - core/trunk/src/test/java/org/jboss/cache/profiling.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Tue Sep 16 08:14:36 EDT 2008
Author: manik.surtani at jboss.com
Date: 2008-09-16 08:14:36 -0400 (Tue, 16 Sep 2008)
New Revision: 6733
Modified:
core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
Log:
Updated tests
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java 2008-09-16 10:28:05 UTC (rev 6732)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java 2008-09-16 12:14:36 UTC (rev 6733)
@@ -54,21 +54,39 @@
public String getJGroupsConfig() throws Exception
{
- String udp = "<jgroupsConfig>\n" +
- " <UDP discard_incompatible_packets=\"true\" enable_bundling=\"true\" enable_diagnostics=\"false\" ip_ttl=\"2\"\n" +
- " loopback=\"false\" max_bundle_size=\"64000\" max_bundle_timeout=\"30\" mcast_addr=\"228.10.10.10\"\n" +
- " mcast_port=\"45588\" mcast_recv_buf_size=\"100000000\" mcast_send_buf_size=\"640000\"\n" +
- " oob_thread_pool.enabled=\"true\" oob_thread_pool.keep_alive_time=\"10000\" oob_thread_pool.max_threads=\"20\"\n" +
- " oob_thread_pool.min_threads=\"8\" oob_thread_pool.queue_enabled=\"false\" oob_thread_pool.queue_max_size=\"10\"\n" +
- " oob_thread_pool.rejection_policy=\"Run\" thread_naming_pattern=\"pl\" thread_pool.enabled=\"true\"\n" +
- " thread_pool.keep_alive_time=\"10000\" thread_pool.max_threads=\"30\" thread_pool.min_threads=\"8\"\n" +
- " thread_pool.queue_enabled=\"false\" thread_pool.queue_max_size=\"10\" thread_pool.rejection_policy=\"Run\"\n" +
- " tos=\"8\" ucast_recv_buf_size=\"20000000\" ucast_send_buf_size=\"640000\" use_concurrent_stack=\"true\"\n" +
- " use_incoming_packet_handler=\"true\"/>\n" +
+ String udp = " <jgroupsConfig>\n" +
+ " <UDP discard_incompatible_packets=\"true\" \n" +
+ " enable_bundling=\"true\" \n" +
+ " enable_diagnostics=\"false\" \n" +
+ " ip_ttl=\"2\"\n" +
+ " loopback=\"true\" \n" +
+ " max_bundle_size=\"64000\" \n" +
+ " max_bundle_timeout=\"30\" \n" +
+ " mcast_addr=\"228.10.10.10\"\n" +
+ " mcast_port=\"45588\" \n" +
+ " mcast_recv_buf_size=\"100000000\" \n" +
+ " mcast_send_buf_size=\"640000\"\n" +
+ " oob_thread_pool.enabled=\"true\" \n" +
+ " oob_thread_pool.keep_alive_time=\"10000\" \n" +
+ " oob_thread_pool.max_threads=\"20\"\n" +
+ " oob_thread_pool.min_threads=\"8\" \n" +
+ " oob_thread_pool.queue_enabled=\"false\"\n" +
+ " oob_thread_pool.rejection_policy=\"Run\" \n" +
+ " thread_naming_pattern=\"pl\" \n" +
+ " thread_pool.enabled=\"true\"\n" +
+ " thread_pool.keep_alive_time=\"10000\" \n" +
+ " thread_pool.max_threads=\"2\" \n" +
+ " thread_pool.min_threads=\"1\"\n" +
+ " thread_pool.queue_enabled=\"true\" \n" +
+ " thread_pool.queue_max_size=\"1000000\" \n" +
+ " thread_pool.rejection_policy=\"discard\"\n" +
+ " tos=\"8\" ucast_recv_buf_size=\"20000000\" \n" +
+ " ucast_send_buf_size=\"640000\" \n" +
+ " use_concurrent_stack=\"true\"/>\n" +
" <PING num_initial_members=\"3\" timeout=\"2000\"/>\n" +
" <MERGE2 max_interval=\"30000\" min_interval=\"10000\"/>\n" +
" <FD_SOCK/>\n" +
- " <FD max_tries=\"5\" shun=\"true\" timeout=\"10000\"/>\n" +
+ " <!--FD max_tries=\"5\" shun=\"true\" timeout=\"10000\"/-->\n" +
" <VERIFY_SUSPECT timeout=\"1500\"/>\n" +
" <pbcast.NAKACK discard_delivered_msgs=\"true\" gc_lag=\"0\" retransmit_timeout=\"300,600,1200,2400,4800\"\n" +
" use_mcast_xmit=\"false\"/>\n" +
@@ -76,7 +94,8 @@
" <pbcast.STABLE desired_avg_gossip=\"50000\" max_bytes=\"400000\" stability_delay=\"1000\"/>\n" +
" <pbcast.GMS join_timeout=\"5000\" print_local_addr=\"true\" shun=\"false\" view_ack_collection_timeout=\"5000\"\n" +
" view_bundling=\"true\"/>\n" +
- " <FC max_credits=\"500000\" min_threshold=\"0.2\"/>\n" +
+ " <FC max_credits=\"500000\" min_threshold=\"0.2\"\n" +
+ " max_block_time=\"20000\" />\n" +
" <FRAG2 frag_size=\"60000\"/>\n" +
" <pbcast.STREAMING_STATE_TRANSFER use_reading_thread=\"true\"/>\n" +
" <pbcast.FLUSH timeout=\"0\"/>\n" +
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-16 10:28:05 UTC (rev 6732)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-16 12:14:36 UTC (rev 6733)
@@ -37,9 +37,7 @@
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().setClusterConfig(getJGroupsConfig());
- cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
cache.start();
waitForTest();
}
@@ -80,8 +78,8 @@
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);
+ 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-16 10:28:05 UTC (rev 6732)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-16 12:14:36 UTC (rev 6733)
@@ -37,14 +37,17 @@
/*
Test configuration options
*/
- protected static final long NUM_OPERATIONS = 500000; // DURATION is replaced with a fixed number of operations instead.
- protected static final int NUM_THREADS = 15;
+ protected static final long NUM_OPERATIONS = 1000000; // DURATION is replaced with a fixed number of operations instead.
+ protected static final int NUM_THREADS = 1;
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
+ protected static final Fqn BELAS_FQN = Fqn.fromString("/a/b/c");
+ protected static final String BELAS_KEY = "bela";
+
private List<Fqn> fqns = new ArrayList<Fqn>(MAX_OVERALL_NODES);
private Random r = new Random();
@@ -56,8 +59,7 @@
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);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
runCompleteTest();
}
@@ -82,9 +84,7 @@
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().setClusterConfig(getJGroupsConfig());
- cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
runCompleteTest();
}
@@ -248,9 +248,11 @@
private void doTest() throws Exception
{
ExecutorService exec = Executors.newFixedThreadPool(NUM_THREADS);
+ // Executor exec = new DirectExecutor();
long startTime = System.currentTimeMillis();
log.warn("Starting test");
int i;
+ long print = NUM_OPERATIONS / 10;
for (i = 0; i < NUM_OPERATIONS; i++)
{
MyRunnable r = null;
@@ -266,6 +268,8 @@
r = new Remover(i);
break;
}
+ if (i % print == 0)
+ log.warn("processing iteration " + i);
exec.execute(r);
// if (USE_SLEEP) TestingUtil.sleepRandom(MAX_RANDOM_SLEEP_MILLIS);
if (USE_SLEEP) TestingUtil.sleepThread(MAX_RANDOM_SLEEP_MILLIS);
@@ -289,20 +293,23 @@
int id;
Mode mode;
+
public void run()
{
- if (id % 100 == 0) log.warn("Processing iteration " + id);
String k = getRandomString();
Fqn f = fqns.get(r.nextInt(MAX_OVERALL_NODES));
switch (mode)
{
case PUT:
cache.put(f, k, getRandomString());
+ // cache.put(BELAS_FQN, BELAS_KEY, new byte[10000]);
break;
case GET:
+ // cache.get(BELAS_FQN, BELAS_KEY);
cache.get(f, k);
break;
case REMOVE:
+ // cache.remove(BELAS_FQN, BELAS_KEY);
cache.remove(f, k);
break;
}
More information about the jbosscache-commits
mailing list