activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r618617 - in /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf: AMQStoreDurableTopicTest.java PerfConsumer.java PerfProducer.java SimpleNonPersistentQueueTest.java SimpleQueueTest.java
Date Tue, 05 Feb 2008 12:05:53 GMT
Author: rajdavies
Date: Tue Feb  5 04:05:52 2008
New Revision: 618617

URL: http://svn.apache.org/viewvc?rev=618617&view=rev
Log:
Updated the performance tests

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfProducer.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueTest.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleQueueTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java?rev=618617&r1=618616&r2=618617&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/AMQStoreDurableTopicTest.java
Tue Feb  5 04:05:52 2008
@@ -38,8 +38,8 @@
     }
     
     protected void setUp() throws Exception {
-        numberofProducers=2;
-        numberOfConsumers=10;
+        numberofProducers=1;
+        numberOfConsumers=1;
         this.consumerSleepDuration=0;
         super.setUp();
     }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java?rev=618617&r1=618616&r2=618617&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfConsumer.java
Tue Feb  5 04:05:52 2008
@@ -26,7 +26,6 @@
 import javax.jms.Session;
 import javax.jms.Topic;
 
-import org.apache.activemq.ActiveMQConnection;
 import org.apache.activemq.ActiveMQMessageAudit;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -39,6 +38,7 @@
     protected Connection connection;
     protected MessageConsumer consumer;
     protected long sleepDuration;
+    protected boolean enableAudit = true;
     protected ActiveMQMessageAudit audit = new ActiveMQMessageAudit(16 * 1024,20);
 
     protected PerfRate rate = new PerfRate();
@@ -79,7 +79,7 @@
     public void onMessage(Message msg) {
         rate.increment();
         try {
-            if (msg.getJMSDestination() instanceof Topic && !this.audit.isInOrder(msg.getJMSMessageID()))
{
+            if (enableAudit && !this.audit.isInOrder(msg.getJMSMessageID())) {
                 LOG.error("Message out of order!!" + msg);
             }
             if (this.audit.isDuplicate(msg)){
@@ -103,5 +103,13 @@
 
     public synchronized void setSleepDuration(long sleepDuration) {
         this.sleepDuration = sleepDuration;
+    }
+
+    public boolean isEnableAudit() {
+        return enableAudit;
+    }
+
+    public void setEnableAudit(boolean doAudit) {
+        this.enableAudit = doAudit;
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfProducer.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfProducer.java?rev=618617&r1=618616&r2=618617&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfProducer.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/PerfProducer.java
Tue Feb  5 04:05:52 2008
@@ -49,6 +49,10 @@
     public void setDeliveryMode(int mode) throws JMSException {
         producer.setDeliveryMode(mode);
     }
+    
+    public void setTimeToLive(int ttl) throws JMSException {
+        producer.setTimeToLive(ttl);
+    }
 
     public void shutDown() throws JMSException {
         connection.close();

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueTest.java?rev=618617&r1=618616&r2=618617&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleNonPersistentQueueTest.java
Tue Feb  5 04:05:52 2008
@@ -29,6 +29,7 @@
     protected PerfProducer createProducer(ConnectionFactory fac, Destination dest, int number,
byte[] payload) throws JMSException {
         PerfProducer pp = new PerfProducer(fac, dest, payload);
         pp.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
+        pp.setTimeToLive(100);
         return pp;
     }
 }

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleQueueTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleQueueTest.java?rev=618617&r1=618616&r2=618617&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleQueueTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/perf/SimpleQueueTest.java
Tue Feb  5 04:05:52 2008
@@ -16,6 +16,7 @@
  */
 package org.apache.activemq.perf;
 
+import javax.jms.ConnectionFactory;
 import javax.jms.Destination;
 import javax.jms.JMSException;
 import javax.jms.Session;
@@ -30,10 +31,18 @@
     }
     
     protected void setUp() throws Exception {
-        numberOfConsumers = 10;
-        numberofProducers = 10;
-        this.consumerSleepDuration=20;
+        numberOfConsumers = 1;
+        numberofProducers = 2;
+        this.consumerSleepDuration=0;
         super.setUp();
+    }
+    
+    protected PerfConsumer createConsumer(ConnectionFactory fac, Destination dest, int number)
throws JMSException {
+        PerfConsumer consumer =  new PerfConsumer(fac, dest);
+        boolean enableAudit = numberOfConsumers <= 1;
+        System.out.println("Enable Audit = " + enableAudit);
+        consumer.setEnableAudit(enableAudit);
+        return consumer;
     }
 
 }



Mime
View raw message