activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From foco...@apache.org
Subject svn commit: r412278 - in /incubator/activemq/trunk: activemq-perftest/ tooling/maven-activemq-perf-plugin/ tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/...
Date Wed, 07 Jun 2006 04:09:19 GMT
Author: foconer
Date: Tue Jun  6 21:09:19 2006
New Revision: 412278

URL: http://svn.apache.org/viewvc?rev=412278&view=rev
Log:
Parameter cleanup.

Modified:
    incubator/activemq/trunk/activemq-perftest/pom.xml
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/pom.xml
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ConsumerMojo.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ProducerMojo.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java
    incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java

Modified: incubator/activemq/trunk/activemq-perftest/pom.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/activemq-perftest/pom.xml?rev=412278&r1=412277&r2=412278&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-perftest/pom.xml (original)
+++ incubator/activemq/trunk/activemq-perftest/pom.xml Tue Jun  6 21:09:19 2006
@@ -19,7 +19,6 @@
             <plugin>
                 <groupId>incubator-activemq</groupId>
                 <artifactId>maven-activemq-perf-plugin</artifactId>
-                <version>4.1-SNAPSHOT</version>
             </plugin>
         </plugins>
     </build>

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/pom.xml?rev=412278&r1=412277&r2=412278&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/pom.xml (original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/pom.xml Tue Jun  6 21:09:19
2006
@@ -25,42 +25,34 @@
         <dependency>
             <groupId>incubator-activemq</groupId>
             <artifactId>activemq-core</artifactId>
-            <version>4.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>incubator-activemq</groupId>
             <artifactId>activemq-console</artifactId>
-            <version>4.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>incubator-activemq</groupId>
             <artifactId>activeio-core</artifactId>
-            <version>3.0-beta2</version>
         </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derby</artifactId>
-            <version>10.1.1.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.derby</groupId>
             <artifactId>derbynet</artifactId>
-            <version>10.1.1.0</version>
         </dependency>
         <dependency>
             <groupId>backport-util-concurrent</groupId>
             <artifactId>backport-util-concurrent</artifactId>
-            <version>2.1</version>
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-jms_1.1_spec</artifactId>
-            <version>1.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-j2ee-management_1.0_spec</artifactId>
-            <version>1.0</version>
         </dependency>
     </dependencies>
 </project>

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ConsumerMojo.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ConsumerMojo.java?rev=412278&r1=412277&r2=412278&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ConsumerMojo.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ConsumerMojo.java
Tue Jun  6 21:09:19 2006
@@ -110,11 +110,12 @@
      */
     private String recvCount;
 
-    /**
+    /*
      * @parameter expression="${consumer.recvDuration}" default-value="60000"
      * @required
-     */
+
     private String recvDuration;
+    */
 
     /**
      * @parameter expression="${consumer.recvType}" default-value="time"
@@ -196,36 +197,35 @@
     public String[] createArgument() {
         String[] options = new String[25];
 
-        System.out.println("--- " + duration + " ----");
-        options[0] = "-Dsampler.duration=" + duration;     // 1 min
-        options[1] = "-Dsampler.interval=" + interval;      // 5 secs
-        options[2] = "-Dsampler.rampUpTime=" + rampUpTime;   // 10 secs
-        options[3] = "-Dsampler.rampDownTime=" + rampDownTime; // 10 secs
-
-        options[4] = "-Dclient.spiClass=" + spiClass;
-        options[5] = "-Dclient.sessTransacted=" + sessTransacted;
-        options[6] = "-Dclient.sessAckMode=" + sessAckMode;
-        options[7] = "-Dclient.destName=" + destName;
-        options[8] = "-Dclient.destCount=" + destCount;
-        options[9] = "-Dclient.destComposite=" + destComposite;
-
-        options[10] = "-Dconsumer.durable=" + durable;
-        options[11] = "-Dconsumer.asyncRecv=" + asyncRecv;
-        options[12] = "-Dconsumer.recvCount=" + recvCount;     // 1000 messages
-        options[13] = "-Dconsumer.recvDuration=" + recvDuration; // 1 min
-        options[14] = "-Dconsumer.recvType=" + recvType;
-
-        options[15] = "-Dfactory.brokerUrl=" + brokerUrl;
-        options[16] = "-Dfactory.optimAck=" + optimAck;
-        options[17] = "-Dfactory.optimDispatch=" + optimDispatch;
-        options[18] = "-Dfactory.prefetchQueue=" + prefetchQueue;
-        options[19] = "-Dfactory.prefetchTopic=" + prefetchTopic;
-        options[20] = "-Dfactory.useRetroactive=" + useRetroactive;
-
-        options[21] = "-DsysTest.numClients=" + numClients;
-        options[22] = "-DsysTest.totalDests=" + totalDests;
-        options[23] = "-DsysTest.destDistro=" + destDistro;
-        options[24] = "-DsysTest.reportDirectory=" + reportDirectory;
+        options[0] = "sampler.duration=" + duration;     // 1 min
+        options[1] = "sampler.interval=" + interval;      // 5 secs
+        options[2] = "sampler.rampUpTime=" + rampUpTime;   // 10 secs
+        options[3] = "sampler.rampDownTime=" + rampDownTime; // 10 secs
+
+        options[4] = "client.spiClass=" + spiClass;
+        options[5] = "client.sessTransacted=" + sessTransacted;
+        options[6] = "client.sessAckMode=" + sessAckMode;
+        options[7] = "client.destName=" + destName;
+        options[8] = "client.destCount=" + destCount;
+        options[9] = "client.destComposite=" + destComposite;
+
+        options[10] = "consumer.durable=" + durable;
+        options[11] = "consumer.asyncRecv=" + asyncRecv;
+        options[12] = "consumer.recvCount=" + recvCount;     // 1000 messages
+        options[13] = "consumer.recvDuration=" + duration; // use sampler.duration.
+        options[14] = "consumer.recvType=" + recvType;
+
+        options[15] = "factory.brokerUrl=" + brokerUrl;
+        options[16] = "factory.optimAck=" + optimAck;
+        options[17] = "factory.optimDispatch=" + optimDispatch;
+        options[18] = "factory.prefetchQueue=" + prefetchQueue;
+        options[19] = "factory.prefetchTopic=" + prefetchTopic;
+        options[20] = "factory.useRetroactive=" + useRetroactive;
+
+        options[21] = "sysTest.numClients=" + numClients;
+        options[22] = "sysTest.totalDests=" + totalDests;
+        options[23] = "sysTest.destDistro=" + destDistro;
+        options[24] = "sysTest.reportDirectory=" + reportDirectory;
 
         return options;
     }

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ProducerMojo.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ProducerMojo.java?rev=412278&r1=412277&r2=412278&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ProducerMojo.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/maven/ProducerMojo.java
Tue Jun  6 21:09:19 2006
@@ -102,11 +102,12 @@
      */
     private String sendCount;
 
-    /**
+    /*
      * @parameter expression="${producer.sendDuration}" default-value="60000"
      * @required
-     */
+
     private String sendDuration;
+    */
 
     /**
      * @parameter expression="${producer.sendType}" default-value="time"
@@ -160,30 +161,30 @@
     public String[] createArgument() {
 
         String[] options = new String[20];
-        options[0] = "-Dsampler.duration=" + duration;     // 1 min
-        options[1] = "-Dsampler.interval=" + interval;      // 5 secs
-        options[2] = "-Dsampler.rampUpTime=" + rampUpTime;   // 10 secs
-        options[3] = "-Dsampler.rampDownTime=" + rampDownTime; // 10 secs
-
-        options[4] = "-Dclient.spiClass=" + spiClass;
-        options[5] = "-Dclient.sessTransacted=" + sessTransacted;
-        options[6] = "-Dclient.sessAckMode=" + sessAckMode;
-        options[7] = "-Dclient.destName=" + destName;
-        options[8] = "-Dclient.destCount=" + destCount;
-        options[9] = "-Dclient.destComposite=" + destComposite;
-
-        options[10] = "-Dproducer.messageSize="+messageSize;
-        options[11] = "-Dproducer.sendCount="+sendCount;     // 1000 messages
-        options[12] = "-Dproducer.sendDuration="+sendDuration; // 1 min
-        options[13] = "-Dproducer.sendType="+sendType;
-
-        options[14] = "-Dfactory.brokerUrl="+brokerUrl;
-        options[15] = "-Dfactory.asyncSend="+asyncSend;
-
-        options[16] = "-DsysTest.numClients=" + numClients;
-        options[17] = "-DsysTest.totalDests=" + totalDests;
-        options[18] = "-DsysTest.destDistro=" + destDistro;
-        options[19] = "-DsysTest.reportDirectory=" + reportDirectory;
+        options[0] = "sampler.duration=" + duration;     // 1 min
+        options[1] = "sampler.interval=" + interval;      // 5 secs
+        options[2] = "sampler.rampUpTime=" + rampUpTime;   // 10 secs
+        options[3] = "sampler.rampDownTime=" + rampDownTime; // 10 secs
+
+        options[4] = "client.spiClass=" + spiClass;
+        options[5] = "client.sessTransacted=" + sessTransacted;
+        options[6] = "client.sessAckMode=" + sessAckMode;
+        options[7] = "client.destName=" + destName;
+        options[8] = "client.destCount=" + destCount;
+        options[9] = "client.destComposite=" + destComposite;
+
+        options[10] = "producer.messageSize="+messageSize;
+        options[11] = "producer.sendCount="+sendCount;     // 1000 messages
+        options[12] = "producer.sendDuration="+duration; // use sampler.duration.
+        options[13] = "producer.sendType="+sendType;
+
+        options[14] = "factory.brokerUrl="+brokerUrl;
+        options[15] = "factory.asyncSend="+asyncSend;
+
+        options[16] = "sysTest.numClients=" + numClients;
+        options[17] = "sysTest.totalDests=" + totalDests;
+        options[18] = "sysTest.destDistro=" + destDistro;
+        options[19] = "sysTest.reportDirectory=" + reportDirectory;
 
         return options;
     }

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java?rev=412278&r1=412277&r2=412278&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerClient.java
Tue Jun  6 21:09:19 2006
@@ -17,36 +17,30 @@
 
 package org.apache.activemq.tool;
 
-import org.apache.commons.logging.LogFactory;
+import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
 import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
-import javax.jms.MessageListener;
-import javax.jms.MessageConsumer;
-import javax.jms.JMSException;
-import javax.jms.Destination;
-import javax.jms.Topic;
-import javax.jms.Message;
+import javax.jms.*;
 import java.util.Properties;
 
-import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicInteger;
-
 public class JmsConsumerClient extends JmsPerformanceSupport {
     private static final Log log = LogFactory.getLog(JmsConsumerClient.class);
 
     private static final String PREFIX_CONFIG_CONSUMER = "consumer.";
-    public  static final String TIME_BASED_RECEIVING  = "time";
-    public  static final String COUNT_BASED_RECEIVING = "count";
+    public static final String TIME_BASED_RECEIVING = "time";
+    public static final String COUNT_BASED_RECEIVING = "count";
 
-    protected Properties      jmsConsumerSettings = new Properties();
+    protected Properties jmsConsumerSettings = new Properties();
     protected MessageConsumer jmsConsumer;
 
-    protected boolean durable   = false;
+    protected boolean durable = false;
     protected boolean asyncRecv = true;
-    protected String  consumerName = "TestConsumerClient";
+    protected String consumerName = "TestConsumerClient";
 
-    protected long   recvCount    = 1000000;       // Receive a million messages by default
-    protected long   recvDuration = 5 * 60 * 1000; // Receive for 5 mins by default
-    protected String recvType     = TIME_BASED_RECEIVING;
+    protected long recvCount = 1000000;       // Receive a million messages by default
+    protected long recvDuration = 5 * 60 * 1000; // Receive for 5 mins by default
+    protected String recvType = TIME_BASED_RECEIVING;
 
     public void receiveMessages() throws JMSException {
         if (listener != null) {
@@ -157,7 +151,7 @@
 
     public MessageConsumer createJmsConsumer(Destination dest) throws JMSException {
         if (isDurable()) {
-            jmsConsumer = getSession().createDurableSubscriber((Topic)dest, getConsumerName());
+            jmsConsumer = getSession().createDurableSubscriber((Topic) dest, getConsumerName());
         } else {
             jmsConsumer = getSession().createConsumer(dest);
         }
@@ -166,7 +160,7 @@
 
     public MessageConsumer createJmsConsumer(Destination dest, String selector, boolean noLocal)
throws JMSException {
         if (isDurable()) {
-            jmsConsumer = getSession().createDurableSubscriber((Topic)dest, getConsumerName(),
selector, noLocal);
+            jmsConsumer = getSession().createDurableSubscriber((Topic) dest, getConsumerName(),
selector, noLocal);
         } else {
             jmsConsumer = getSession().createConsumer(dest, selector, noLocal);
         }
@@ -254,50 +248,21 @@
     }
 
     public static void main(String[] args) throws JMSException {
-        /*String[] options = new String[21];
-        options[0] = "-Dsampler.duration=60000";     // 1 min
-        options[1] = "-Dsampler.interval=5000";      // 5 secs
-        options[2] = "-Dsampler.rampUpTime=10000";   // 10 secs
-        options[3] = "-Dsampler.rampDownTime=10000"; // 10 secs
-
-        options[4] = "-Dclient.spiClass=org.apache.activemq.tool.spi.ActiveMQPojoSPI";
-        options[5] = "-Dclient.sessTransacted=false";
-        options[6] = "-Dclient.sessAckMode=autoAck";
-        options[7] = "-Dclient.destName=topic://FOO.BAR.TEST";
-        options[8] = "-Dclient.destCount=1";
-        options[9] = "-Dclient.destComposite=false";
-
-        options[10] = "-Dconsumer.durable=false";
-        options[11] = "-Dconsumer.asyncRecv=true";
-        options[12] = "-Dconsumer.recvCount=1000";     // 1000 messages
-        options[13] = "-Dconsumer.recvDuration=60000"; // 1 min
-        options[14] = "-Dconsumer.recvType=time";
-
-        options[15] = "-Dfactory.brokerUrl=tcp://localhost:61616";
-        options[16] = "-Dfactory.optimAck=true";
-        options[17] = "-Dfactory.optimDispatch=true";
-        options[18] = "-Dfactory.prefetchQueue=100";
-        options[19] = "-Dfactory.prefetchTopic=32767";
-        options[20] = "-Dfactory.useRetroactive=false";
 
-        args = options;   */
-
-        Properties samplerSettings  = new Properties();
+        Properties samplerSettings = new Properties();
         Properties consumerSettings = new Properties();
 
-        for (int i=0; i<args.length; i++) {
+        for (int i = 0; i < args.length; i++) {
             // Get property define options only
-            if (args[i].startsWith("-D")) {
-                String propDefine = args[i].substring("-D".length());
-                int  index = propDefine.indexOf("=");
-                String key = propDefine.substring(0, index);
-                String val = propDefine.substring(index+1);
-                if (key.startsWith("sampler.")) {
-                    samplerSettings.setProperty(key, val);
-                } else {
-                    consumerSettings.setProperty(key, val);
-                }
+            int index = args[i].indexOf("=");
+            String key = args[i].substring(0, index);
+            String val = args[i].substring(index + 1);
+            if (key.startsWith("sampler.")) {
+                samplerSettings.setProperty(key, val);
+            } else {
+                consumerSettings.setProperty(key, val);
             }
+
         }
 
         JmsConsumerClient client = new JmsConsumerClient();

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java?rev=412278&r1=412277&r2=412278&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsConsumerSystem.java
Tue Jun  6 21:09:19 2006
@@ -31,7 +31,7 @@
             sampler.registerClient(consumer);
             consumer.setPerfEventListener(sampler);
         }
-        
+
         try {
             consumer.receiveMessages();
         } catch (JMSException e) {
@@ -52,49 +52,13 @@
     }
 
     public static void main(String[] args) throws JMSException {
-        /*String[] options = new String[25];
-        options[0] = "-Dsampler.duration=60000";     // 1 min
-        options[1] = "-Dsampler.interval=5000";      // 5 secs
-        options[2] = "-Dsampler.rampUpTime=10000";   // 10 secs
-        options[3] = "-Dsampler.rampDownTime=10000"; // 10 secs
-
-        options[4] = "-Dclient.spiClass=org.apache.activemq.tool.spi.ActiveMQPojoSPI";
-        options[5] = "-Dclient.sessTransacted=false";
-        options[6] = "-Dclient.sessAckMode=autoAck";
-        options[7] = "-Dclient.destName=topic://FOO.BAR.TEST";
-        options[8] = "-Dclient.destCount=1";
-        options[9] = "-Dclient.destComposite=false";
-
-        options[10] = "-Dconsumer.durable=false";
-        options[11] = "-Dconsumer.asyncRecv=true";
-        options[12] = "-Dconsumer.recvCount=1000";     // 1000 messages
-        options[13] = "-Dconsumer.recvDuration=60000"; // 1 min
-        options[14] = "-Dconsumer.recvType=time";
-
-        options[15] = "-Dfactory.brokerUrl=tcp://localhost:61616";
-        options[16] = "-Dfactory.optimAck=true";
-        options[17] = "-Dfactory.optimDispatch=true";
-        options[18] = "-Dfactory.prefetchQueue=10";
-        options[19] = "-Dfactory.prefetchTopic=10";
-        options[20] = "-Dfactory.useRetroactive=false";
-
-        options[21] = "-DsysTest.numClients=5";
-        options[22] = "-DsysTest.totalDests=5";
-        options[23] = "-DsysTest.destDistro=all";
-        options[24] = "-DsysTest.reportDirectory=./target/test-perf";
-
-        args = options;*/
-
-        Properties sysSettings  = new Properties();
-        for (int i=0; i<args.length; i++) {
+        Properties sysSettings = new Properties();
+        for (int i = 0; i < args.length; i++) {
             // Get property define options only
-            if (args[i].startsWith("-D")) {
-                String propDefine = args[i].substring("-D".length());
-                int  index = propDefine.indexOf("=");
-                String key = propDefine.substring(0, index);
-                String val = propDefine.substring(index+1);
-                sysSettings.setProperty(key, val);
-            }
+            int index = args[i].indexOf("=");
+            String key = args[i].substring(0, index);
+            String val = args[i].substring(index + 1);
+            sysSettings.setProperty(key, val);
         }
 
         JmsConsumerSystem sysTest = new JmsConsumerSystem();

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java?rev=412278&r1=412277&r2=412278&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerClient.java
Tue Jun  6 21:09:19 2006
@@ -19,28 +19,28 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.jms.MessageProducer;
 import javax.jms.Destination;
-import javax.jms.TextMessage;
 import javax.jms.JMSException;
-import java.util.Properties;
+import javax.jms.MessageProducer;
+import javax.jms.TextMessage;
 import java.util.Arrays;
+import java.util.Properties;
 
 public class JmsProducerClient extends JmsPerformanceSupport {
     private static final Log log = LogFactory.getLog(JmsProducerClient.class);
 
     private static final String PREFIX_CONFIG_PRODUCER = "producer.";
-    public  static final String TIME_BASED_SENDING  = "time";
-    public  static final String COUNT_BASED_SENDING = "count";
+    public static final String TIME_BASED_SENDING = "time";
+    public static final String COUNT_BASED_SENDING = "count";
 
-    protected Properties      jmsProducerSettings = new Properties();
+    protected Properties jmsProducerSettings = new Properties();
     protected MessageProducer jmsProducer;
-    protected TextMessage     jmsTextMessage;
+    protected TextMessage jmsTextMessage;
 
-    protected int    messageSize  = 1024;          // Send 1kb messages by default
-    protected long   sendCount    = 1000000;       // Send a million messages by default
-    protected long   sendDuration = 5 * 60 * 1000; // Send for 5 mins by default
-    protected String sendType     = TIME_BASED_SENDING;
+    protected int messageSize = 1024;          // Send 1kb messages by default
+    protected long sendCount = 1000000;       // Send a million messages by default
+    protected long sendDuration = 5 * 60 * 1000; // Send for 5 mins by default
+    protected String sendType = TIME_BASED_SENDING;
 
     public void sendMessages() throws JMSException {
         if (listener != null) {
@@ -50,7 +50,7 @@
         if (sendType.equalsIgnoreCase(COUNT_BASED_SENDING)) {
             sendCountBasedMessages(getSendCount());
 
-        // Send messages for a specific duration
+            // Send messages for a specific duration
         } else {
             sendTimeBasedMessages(getSendDuration());
         }
@@ -78,36 +78,36 @@
             if (getJmsTextMessage() != null) {
                 // Send to more than one actual destination
                 if (dest.length > 1) {
-                    for (int i=0; i<messageCount; i++) {
-                        for (int j=0; j<dest.length; j++) {
+                    for (int i = 0; i < messageCount; i++) {
+                        for (int j = 0; j < dest.length; j++) {
                             getJmsProducer().send(dest[j], getJmsTextMessage());
                             incThroughput();
                         }
                     }
-                // Send to only one actual destination
+                    // Send to only one actual destination
                 } else {
-                    for (int i=0; i<messageCount; i++) {
+                    for (int i = 0; i < messageCount; i++) {
                         getJmsProducer().send(getJmsTextMessage());
                         incThroughput();
                     }
                 }
 
-            // Send different type of messages using indexing to identify each one.
-            // Message size will vary. Definitely slower, since messages properties
-            // will be set individually each send.
+                // Send different type of messages using indexing to identify each one.
+                // Message size will vary. Definitely slower, since messages properties
+                // will be set individually each send.
             } else {
                 // Send to more than one actual destination
                 if (dest.length > 1) {
-                    for (int i=0; i<messageCount; i++) {
-                        for (int j=0; j<dest.length; j++) {
+                    for (int i = 0; i < messageCount; i++) {
+                        for (int j = 0; j < dest.length; j++) {
                             getJmsProducer().send(dest[j], createJmsTextMessage("Text Message
[" + i + "]"));
                             incThroughput();
                         }
                     }
 
-                // Send to only one actual destination
+                    // Send to only one actual destination
                 } else {
-                    for (int i=0; i<messageCount; i++) {
+                    for (int i = 0; i < messageCount; i++) {
                         getJmsProducer().send(createJmsTextMessage("Text Message [" + i +
"]"));
                         incThroughput();
                     }
@@ -122,7 +122,7 @@
     }
 
     public void sendTimeBasedMessages(long duration) throws JMSException {
-        long endTime   = System.currentTimeMillis() + duration;
+        long endTime = System.currentTimeMillis() + duration;
         // Parse through different ways to send messages
         // Avoided putting the condition inside the loop to prevent effect on performance
 
@@ -148,12 +148,12 @@
                 // Send to more than one actual destination
                 if (dest.length > 1) {
                     while (System.currentTimeMillis() < endTime) {
-                        for (int j=0; j<dest.length; j++) {
+                        for (int j = 0; j < dest.length; j++) {
                             getJmsProducer().send(dest[j], getJmsTextMessage());
                             incThroughput();
                         }
                     }
-                // Send to only one actual destination
+                    // Send to only one actual destination
                 } else {
                     while (System.currentTimeMillis() < endTime) {
                         getJmsProducer().send(getJmsTextMessage());
@@ -161,21 +161,21 @@
                     }
                 }
 
-            // Send different type of messages using indexing to identify each one.
-            // Message size will vary. Definitely slower, since messages properties
-            // will be set individually each send.
+                // Send different type of messages using indexing to identify each one.
+                // Message size will vary. Definitely slower, since messages properties
+                // will be set individually each send.
             } else {
                 // Send to more than one actual destination
                 long count = 1;
                 if (dest.length > 1) {
                     while (System.currentTimeMillis() < endTime) {
-                        for (int j=0; j<dest.length; j++) {
+                        for (int j = 0; j < dest.length; j++) {
                             getJmsProducer().send(dest[j], createJmsTextMessage("Text Message
[" + count++ + "]"));
                             incThroughput();
                         }
                     }
 
-                // Send to only one actual destination
+                    // Send to only one actual destination
                 } else {
                     while (System.currentTimeMillis() < endTime) {
 
@@ -235,7 +235,7 @@
 
     protected String buildText(String text, int size) {
         byte[] data = new byte[size - text.length()];
-        Arrays.fill(data, (byte)0);
+        Arrays.fill(data, (byte) 0);
         return text + new String(data);
     }
 
@@ -291,45 +291,20 @@
     }
 
     public static void main(String[] args) throws JMSException {
-        /*String[] options = new String[16];
-        options[0] = "-Dsampler.duration=60000";     // 1 min
-        options[1] = "-Dsampler.interval=5000";      // 5 secs
-        options[2] = "-Dsampler.rampUpTime=10000";   // 10 secs
-        options[3] = "-Dsampler.rampDownTime=10000"; // 10 secs
-
-        options[4] = "-Dclient.spiClass=org.apache.activemq.tool.spi.ActiveMQPojoSPI";
-        options[5] = "-Dclient.sessTransacted=false";
-        options[6] = "-Dclient.sessAckMode=autoAck";
-        options[7] = "-Dclient.destName=topic://FOO.BAR.TEST";
-        options[8] = "-Dclient.destCount=1";
-        options[9] = "-Dclient.destComposite=false";
-
-        options[10] = "-Dproducer.messageSize=1024";
-        options[11] = "-Dproducer.sendCount=1000";     // 1000 messages
-        options[12] = "-Dproducer.sendDuration=60000"; // 1 min
-        options[13] = "-Dproducer.sendType=time";
-
-        options[14] = "-Dfactory.brokerUrl=tcp://localhost:61616";
-        options[15] = "-Dfactory.asyncSend=true";
-
-        args = options;*/
-
-        Properties samplerSettings  = new Properties();
+        Properties samplerSettings = new Properties();
         Properties producerSettings = new Properties();
 
-        for (int i=0; i<args.length; i++) {
+        for (int i = 0; i < args.length; i++) {
             // Get property define options only
-            if (args[i].startsWith("-D")) {
-                String propDefine = args[i].substring("-D".length());
-                int  index = propDefine.indexOf("=");
-                String key = propDefine.substring(0, index);
-                String val = propDefine.substring(index+1);
-                if (key.startsWith("sampler.")) {
-                    samplerSettings.setProperty(key, val);
-                } else {
-                    producerSettings.setProperty(key, val);
-                }
+            int index = args[i].indexOf("=");
+            String key = args[i].substring(0, index);
+            String val = args[i].substring(index + 1);
+            if (key.startsWith("sampler.")) {
+                samplerSettings.setProperty(key, val);
+            } else {
+                producerSettings.setProperty(key, val);
             }
+
         }
 
         JmsProducerClient client = new JmsProducerClient();

Modified: incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java
URL: http://svn.apache.org/viewvc/incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java?rev=412278&r1=412277&r2=412278&view=diff
==============================================================================
--- incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java
(original)
+++ incubator/activemq/trunk/tooling/maven-activemq-perf-plugin/src/main/java/org/apache/activemq/tool/JmsProducerSystem.java
Tue Jun  6 21:09:19 2006
@@ -52,45 +52,14 @@
     }
 
     public static void main(String[] args) {
-        /*String[] options = new String[20];
-        options[0] = "-Dsampler.duration=60000";     // 1 min
-        options[1] = "-Dsampler.interval=5000";      // 5 secs
-        options[2] = "-Dsampler.rampUpTime=10000";   // 10 secs
-        options[3] = "-Dsampler.rampDownTime=10000"; // 10 secs
+        Properties sysSettings = new Properties();
 
-        options[4] = "-Dclient.spiClass=org.apache.activemq.tool.spi.ActiveMQPojoSPI";
-        options[5] = "-Dclient.sessTransacted=false";
-        options[6] = "-Dclient.sessAckMode=autoAck";
-        options[7] = "-Dclient.destName=topic://FOO.BAR.TEST";
-        options[8] = "-Dclient.destCount=1";
-        options[9] = "-Dclient.destComposite=false";
-
-        options[10] = "-Dproducer.messageSize=1024";
-        options[11] = "-Dproducer.sendCount=1000";     // 1000 messages
-        options[12] = "-Dproducer.sendDuration=60000"; // 1 min
-        options[13] = "-Dproducer.sendType=time";
-
-        options[14] = "-Dfactory.brokerUrl=tcp://localhost:61616";
-        options[15] = "-Dfactory.asyncSend=true";
-
-        options[16] = "-DsysTest.numClients=5";
-        options[17] = "-DsysTest.totalDests=5";
-        options[18] = "-DsysTest.destDistro=all";
-        options[19] = "-DsysTest.reportDirectory=./target/test-perf";
-
-        args = options; */
-
-        Properties sysSettings  = new Properties();
-
-        for (int i=0; i<args.length; i++) {
+        for (int i = 0; i < args.length; i++) {
             // Get property define options only
-            if (args[i].startsWith("-D")) {
-                String propDefine = args[i].substring("-D".length());
-                int  index = propDefine.indexOf("=");
-                String key = propDefine.substring(0, index);
-                String val = propDefine.substring(index+1);
-                sysSettings.setProperty(key, val);
-            }
+            int index = args[i].indexOf("=");
+            String key = args[i].substring(0, index);
+            String val = args[i].substring(index + 1);
+            sysSettings.setProperty(key, val);
         }
 
         JmsProducerSystem sysTest = new JmsProducerSystem();



Mime
View raw message