Parameter cleanup.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@412278 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Frederick G. Oconer 2006-06-07 04:09:19 +00:00
parent 99b088dcd4
commit 4fb36fe50c
8 changed files with 131 additions and 266 deletions

View File

@ -19,7 +19,6 @@
<plugin>
<groupId>incubator-activemq</groupId>
<artifactId>maven-activemq-perf-plugin</artifactId>
<version>4.1-SNAPSHOT</version>
</plugin>
</plugins>
</build>

View File

@ -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>

View File

@ -110,11 +110,12 @@ public class ConsumerMojo
*/
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 class ConsumerMojo
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[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] = "-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[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] = "-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[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] = "-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[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] = "-DsysTest.numClients=" + numClients;
options[22] = "-DsysTest.totalDests=" + totalDests;
options[23] = "-DsysTest.destDistro=" + destDistro;
options[24] = "-DsysTest.reportDirectory=" + reportDirectory;
options[21] = "sysTest.numClients=" + numClients;
options[22] = "sysTest.totalDests=" + totalDests;
options[23] = "sysTest.destDistro=" + destDistro;
options[24] = "sysTest.reportDirectory=" + reportDirectory;
return options;
}

View File

@ -102,11 +102,12 @@ public class ProducerMojo
*/
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 class ProducerMojo
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[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] = "-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[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] = "-Dproducer.messageSize="+messageSize;
options[11] = "-Dproducer.sendCount="+sendCount; // 1000 messages
options[12] = "-Dproducer.sendDuration="+sendDuration; // 1 min
options[13] = "-Dproducer.sendType="+sendType;
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] = "-Dfactory.brokerUrl="+brokerUrl;
options[15] = "-Dfactory.asyncSend="+asyncSend;
options[14] = "factory.brokerUrl="+brokerUrl;
options[15] = "factory.asyncSend="+asyncSend;
options[16] = "-DsysTest.numClients=" + numClients;
options[17] = "-DsysTest.totalDests=" + totalDests;
options[18] = "-DsysTest.destDistro=" + destDistro;
options[19] = "-DsysTest.reportDirectory=" + reportDirectory;
options[16] = "sysTest.numClients=" + numClients;
options[17] = "sysTest.totalDests=" + totalDests;
options[18] = "sysTest.destDistro=" + destDistro;
options[19] = "sysTest.reportDirectory=" + reportDirectory;
return options;
}

View File

@ -17,18 +17,12 @@
package org.apache.activemq.tool;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.logging.Log;
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 java.util.Properties;
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.*;
import java.util.Properties;
public class JmsConsumerClient extends JmsPerformanceSupport {
private static final Log log = LogFactory.getLog(JmsConsumerClient.class);
@ -254,50 +248,21 @@ public class JmsConsumerClient extends JmsPerformanceSupport {
}
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 consumerSettings = 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);
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();

View File

@ -52,50 +52,14 @@ public class JmsConsumerSystem extends JmsClientSystemSupport {
}
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++) {
// 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);
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();
sysTest.setSettings(sysSettings);

View File

@ -19,12 +19,12 @@ package org.apache.activemq.tool;
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);
@ -291,45 +291,20 @@ public class JmsProducerClient extends JmsPerformanceSupport {
}
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 producerSettings = 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);
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();

View File

@ -52,46 +52,15 @@ public class JmsProducerSystem extends JmsClientSystemSupport {
}
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
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++) {
// 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);
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();
sysTest.setSettings(sysSettings);