activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r954604 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/
Date Mon, 14 Jun 2010 19:35:18 GMT
Author: rajdavies
Date: Mon Jun 14 19:35:17 2010
New Revision: 954604

URL: http://svn.apache.org/viewvc?rev=954604&view=rev
Log:
updated performance tests

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTopicTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTransactedTopicTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBQueueTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/NumberOfDestinationsTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/RunBroker.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTopicTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTopicTest.java?rev=954604&r1=954603&r2=954604&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTopicTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTopicTest.java
Mon Jun 14 19:35:17 2010
@@ -16,10 +16,8 @@
  */
 package org.apache.activemq.perf;
 
-import java.io.File;
 import org.apache.activemq.ActiveMQConnectionFactory;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.store.kahadb.KahaDBStore;
 
 /**
  * @version $Revision: 1.3 $
@@ -28,7 +26,7 @@ public class KahaDBDurableTopicTest exte
 
     @Override
     protected void setUp() throws Exception {
-        this.initialConsumerDelay = 10 * 1000;
+        //this.initialConsumerDelay = 10 * 1000;
         super.setUp();
     }
     
@@ -38,36 +36,16 @@ public class KahaDBDurableTopicTest exte
         //result.setDispatchAsync(false);
         return result;
     }
-
+    
     @Override
-    protected void configureBroker(BrokerService answer, String uri) throws Exception {
-
-        File dataFileDir = new File("target/test-amq-data/perfTest/kahadb");
-        File archiveDir = new File(dataFileDir, "archive");
-        KahaDBStore kaha = new KahaDBStore();
-        kaha.setDirectory(dataFileDir);
-        kaha.setDirectoryArchive(archiveDir);
-        //kaha.setArchiveDataLogs(true);
-
-        // The setEnableJournalDiskSyncs(false) setting is a little dangerous
-        // right now, as I have not verified
-        // what happens if the index is updated but a journal update is lost.
-        // Index is going to be in consistent, but can it be repaired?
-        kaha.setEnableJournalDiskSyncs(false);
-        // Using a bigger journal file size makes he take fewer spikes as it is
-        // not switching files as often.
-        // kaha.setJournalMaxFileLength(1024*1024*100);
-
-        // small batch means more frequent and smaller writes
-        kaha.setIndexWriteBatchSize(100);
-        kaha.setIndexCacheSize(1000);
-        // do the index write in a separate thread
-        //kaha.setEnableIndexWriteAsync(true);
-
-        answer.setPersistenceAdapter(kaha);
-        answer.addConnector(uri);
+    protected void configureBroker(BrokerService answer,String uri) throws Exception {
+        //AMQPersistenceAdapterFactory persistenceFactory = new AMQPersistenceAdapterFactory();
+        //persistenceFactory.setMaxFileLength(1024*16);
+        //persistenceFactory.setPersistentIndex(true);
+        //persistenceFactory.setCleanupInterval(10000);
+        //answer.setPersistenceFactory(persistenceFactory);
         answer.setDeleteAllMessagesOnStartup(true);
-
+        answer.addConnector(uri);
+        answer.setUseShutdownHook(false);
     }
-
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTransactedTopicTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTransactedTopicTest.java?rev=954604&r1=954603&r2=954604&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTransactedTopicTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBDurableTransactedTopicTest.java
Mon Jun 14 19:35:17 2010
@@ -17,6 +17,7 @@
 package org.apache.activemq.perf;
 
 import javax.jms.ConnectionFactory;
+import javax.jms.DeliveryMode;
 import javax.jms.Destination;
 import javax.jms.JMSException;
 
@@ -26,8 +27,15 @@ import javax.jms.JMSException;
 public class KahaDBDurableTransactedTopicTest extends KahaDBDurableTopicTest {
 
     @Override
+    protected void setUp() throws Exception {
+        //this.initialConsumerDelay = 10 * 1000;
+        super.setUp();
+    }
+    @Override
     protected PerfProducer createProducer(ConnectionFactory fac, Destination dest, int number,
byte[] payload) throws JMSException {
-        return new PerfProducer(fac, dest, payload, true);
+        PerfProducer result= new PerfProducer(fac, dest, payload, true);
+        result.setDeliveryMode(DeliveryMode.PERSISTENT);
+        return result;
     }
 
   

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBQueueTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBQueueTest.java?rev=954604&r1=954603&r2=954604&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBQueueTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDBQueueTest.java
Mon Jun 14 19:35:17 2010
@@ -18,7 +18,7 @@ package org.apache.activemq.perf;
 
 import java.io.File;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.store.kahadb.KahaDBStore;
+import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
 
 /**
  * @version $Revision$
@@ -27,7 +27,8 @@ public class KahaDBQueueTest extends Sim
 
     @Override
     protected void setUp() throws Exception {
-       // this.initialConsumerDelay = 10 * 1000;
+        this.numberOfDestinations = 25;
+        this.numberofProducers = 1;
         super.setUp();
     }
     @Override
@@ -35,20 +36,20 @@ public class KahaDBQueueTest extends Sim
 
         File dataFileDir = new File("target/test-amq-data/perfTest/kahadb");
         File archiveDir = new File(dataFileDir,"archive");
-        KahaDBStore kaha = new KahaDBStore();
+        KahaDBPersistenceAdapter kaha = new KahaDBPersistenceAdapter();
         kaha.setDirectory(dataFileDir);
         kaha.setDirectoryArchive(archiveDir);
-        kaha.setArchiveDataLogs(true);
+        kaha.setArchiveDataLogs(false);
 
         // The setEnableJournalDiskSyncs(false) setting is a little dangerous right now,
as I have not verified 
         // what happens if the index is updated but a journal update is lost.
         // Index is going to be in consistent, but can it be repaired?
-        kaha.setEnableJournalDiskSyncs(false);
+        kaha.setEnableJournalDiskSyncs(true);
         // Using a bigger journal file size makes he take fewer spikes as it is not switching
files as often.
         //kaha.setJournalMaxFileLength(1024*1024*100);
         
         // small batch means more frequent and smaller writes
-        kaha.setIndexWriteBatchSize(100);
+        //kaha.setIndexWriteBatchSize(100);
         // do the index write in a separate thread
         kaha.setEnableIndexWriteAsync(true);
         kaha.setIndexCacheSize(10000);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java?rev=954604&r1=954603&r2=954604&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/KahaDurableTopicTest.java
Mon Jun 14 19:35:17 2010
@@ -1,5 +1,5 @@
 /**
- * Licensed to the Apache Software Foundation (ASF) under one or more
+revision 946600 * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.
  * The ASF licenses this file to You under the Apache License, Version 2.0
@@ -32,6 +32,7 @@ public class KahaDurableTopicTest extend
      * result=factory.getBroker(); result.start(); return result; }
      */
 
+    @Override
     protected void configureBroker(BrokerService answer,String uri) throws Exception {
         KahaPersistenceAdapter adaptor = new KahaPersistenceAdapter();
         answer.setPersistenceAdapter(adaptor);

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/NumberOfDestinationsTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/NumberOfDestinationsTest.java?rev=954604&r1=954603&r2=954604&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/NumberOfDestinationsTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/NumberOfDestinationsTest.java
Mon Jun 14 19:35:17 2010
@@ -20,11 +20,6 @@ package org.apache.activemq.perf;
  * A NumberOfDestinationsTest
  *
  */
-import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.store.kahadb.KahaDBStore;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import java.io.File;
 import javax.jms.Connection;
 import javax.jms.ConnectionFactory;
@@ -33,9 +28,12 @@ import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.MessageProducer;
 import javax.jms.Session;
-import javax.jms.TemporaryQueue;
-import javax.jms.TemporaryTopic;
 import junit.framework.TestCase;
+import org.apache.activemq.ActiveMQConnectionFactory;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 /**
  * @version $Revision: 1.3 $
  */
@@ -73,6 +71,7 @@ public class NumberOfDestinationsTest ex
         return session.createTopic(topicName);
     }
 
+    @Override
     protected void setUp() throws Exception {
         if (broker == null) {
             broker = createBroker();
@@ -80,6 +79,7 @@ public class NumberOfDestinationsTest ex
         super.setUp();
     }
 
+    @Override
     protected void tearDown() throws Exception {
         super.tearDown();
         if (broker != null) {
@@ -102,7 +102,7 @@ public class NumberOfDestinationsTest ex
     protected void configureBroker(BrokerService answer) throws Exception {
         File dataFileDir = new File("target/test-amq-data/perfTest/kahadb");
 
-        KahaDBStore kaha = new KahaDBStore();
+        KahaDBPersistenceAdapter kaha = new KahaDBPersistenceAdapter();
         kaha.setDirectory(dataFileDir);
         //answer.setUseJmx(false);
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/RunBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/RunBroker.java?rev=954604&r1=954603&r2=954604&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/RunBroker.java (original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/RunBroker.java Mon
Jun 14 19:35:17 2010
@@ -18,45 +18,47 @@ package org.apache.activemq.perf;
 
 import java.io.File;
 import org.apache.activemq.broker.BrokerService;
-import org.apache.activemq.store.kahadaptor.KahaPersistenceAdapter;
-import org.apache.activemq.store.kahadb.KahaDBStore;
+import org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter;
+import org.apache.activemq.util.IOHelper;
 
 public class RunBroker {
 
     public static void main(String arg[]) {
 
         try {
-        KahaPersistenceAdapter adaptor = new KahaPersistenceAdapter();
+            KahaDBPersistenceAdapter kahaDB = new KahaDBPersistenceAdapter();
             File dataFileDir = new File("target/test-amq-data/perfTest/kahadb");
-            File archiveDir = new File(dataFileDir,"archive");
-            KahaDBStore kahaDB = new KahaDBStore();
+            IOHelper.deleteChildren(dataFileDir);
+            File archiveDir = new File(dataFileDir, "archive");
             kahaDB.setDirectory(dataFileDir);
-            kahaDB.setDirectoryArchive(archiveDir);
-            kahaDB.setArchiveDataLogs(true);
 
-            // The setEnableJournalDiskSyncs(false) setting is a little dangerous right now,
as I have not verified 
-            // what happens if the index is updated but a journal update is lost.
+            // The setEnableJournalDiskSyncs(false) setting is a little
+            // dangerous right now, as I have not verified
+            // what happens if the index is updated but a journal update is
+            // lost.
             // Index is going to be in consistent, but can it be repaired?
-            //kaha.setEnableJournalDiskSyncs(false);
-            // Using a bigger journal file size makes he take fewer spikes as it is not switching
files as often.
-            //kaha.setJournalMaxFileLength(1024*1024*100);
-            
+            // kaha.setEnableJournalDiskSyncs(false);
+            // Using a bigger journal file size makes he take fewer spikes as it
+            // is not switching files as often.
+            // kaha.setJournalMaxFileLength(1024*1024*100);
+
             // small batch means more frequent and smaller writes
             kahaDB.setIndexWriteBatchSize(1000);
             kahaDB.setIndexCacheSize(10000);
+
             // do the index write in a separate thread
-            kahaDB.setEnableIndexWriteAsync(true);
-        BrokerService broker = new BrokerService();
-        broker.setUseJmx(false);
-        //broker.setPersistenceAdapter(adaptor);
-        //broker.setPersistenceAdapter(kahaDB);
-        broker.setPersistent(false);
-        broker.setDeleteAllMessagesOnStartup(true);
-        broker.addConnector("tcp://0.0.0.0:61616");
-        broker.start();
-        System.err.println("Running");
-        Thread.sleep(Long.MAX_VALUE);
-        }catch(Throwable e) {
+            // kahaDB.setEnableIndexWriteAsync(true);
+            BrokerService broker = new BrokerService();
+            broker.setUseJmx(false);
+            // broker.setPersistenceAdapter(adaptor);
+            broker.setPersistenceAdapter(kahaDB);
+            // broker.setPersistent(false);
+            broker.setDeleteAllMessagesOnStartup(true);
+            broker.addConnector("tcp://0.0.0.0:61616");
+            broker.start();
+            System.err.println("Running");
+            Thread.sleep(Long.MAX_VALUE);
+        } catch (Throwable e) {
             e.printStackTrace();
         }
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java?rev=954604&r1=954603&r2=954604&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleDurableTopicTest.java
Mon Jun 14 19:35:17 2010
@@ -32,8 +32,8 @@ public class SimpleDurableTopicTest exte
     @Override
     protected void setUp() throws Exception {
         numberOfDestinations=1;
-        numberOfConsumers = 2;
-        numberofProducers = Integer.parseInt(System.getProperty("SimpleDurableTopicTest.numberofProducers",
"1"), 10);
+        numberOfConsumers = 1;
+        numberofProducers = Integer.parseInt(System.getProperty("SimpleDurableTopicTest.numberofProducers",
"20"), 20);
         sampleCount= Integer.parseInt(System.getProperty("SimpleDurableTopicTest.sampleCount",
"1000"), 10);
         playloadSize = 1024;
         super.setUp();



Mime
View raw message