Author: ritchiem
Date: Fri Jan 12 03:10:48 2007
New Revision: 495554
URL: http://svn.apache.org/viewvc?view=rev&rev=495554
Log:
QPID-278
broker distribution - modified to allow assembly:directory builds
broker/pom.xml - moved slf4j to common/pom.xml
QPID-283
Provided better feedback from shell scripts.
Provided QuickTest shell script that runs the RequestReply tests.
perftests distribution - modified to allow assembly:directory builds
Moved Resource Readme content relating to Tests to RunningPerformanceTests.txt
Added:
incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt
(with props)
incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestReply-QuickTest.sh
(with props)
Modified:
incubator/qpid/trunk/qpid/java/perftests/bin/serviceProvidingClient.sh
incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestingClient.sh
incubator/qpid/trunk/qpid/java/perftests/bin/testPingClient.sh
incubator/qpid/trunk/qpid/java/perftests/bin/testPingProducer.sh
incubator/qpid/trunk/qpid/java/perftests/bin/testPingPublisher.sh
incubator/qpid/trunk/qpid/java/perftests/bin/testPingSubscriber.sh
incubator/qpid/trunk/qpid/java/perftests/distribution/pom.xml
incubator/qpid/trunk/qpid/java/perftests/distribution/src/main/assembly/performance.xml
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java
incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j
Added: incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt?view=auto&rev=495554
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt (added)
+++ incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt Fri
Jan 12 03:10:48 2007
@@ -0,0 +1,96 @@
+Running Performance Tests
+-------------------------
+
+This performance test suite contains a number of tests.
+
+- Service request-reply
+- Ping-Pong
+- Headers
+
+Service request-reply
+---------------------
+
+Description:
+This is the simplest test to ensure everything is working. This involves
+one client that is known as a "service provider" and it listens on a
+well-known queue for requests. Another client, known as the "service requester"
+creates a private (temporary) response queue, creates a message with the
+private response queue set as the "reply to" field and then publishes the
+message to the well known service queue. The test allows you to time how long
+it takes to send messages and receive the response back. It also allows
varying
+of the message size.
+
+QuickRun:
+
+./serviceRequestReply-QuickTest.sh <brokerdetails> <number of messages>
+
+This provides a quick test to run everything against a running broker. Simply
specify broker and number of messages to run.
+
+
+Detailed Run:
+
+You must start the service provider first:
+
+serviceProvidingClient.sh <brokerdetails> [<P[ersistent]|N[onPersistent]>
<T[ransacted]|N[onTransacted]>] [selector]
+
+where Brokerdetails is the connection information to the broker you are
running on; e.g. localhost or localhost:5670 or tcp://10.10.10.10:5677.
+By default Non Persistent, Non Transaction messages are used in the response.
A selector may also be specified.
+
+
+To run the service requester:
+
+serviceRequestingClient.sh <Brokerdetails> <Number of Messages> [<Message
Size>] [<P[ersistent]|N[onPersistent]> <T[ransacted]|N[onTransacted]>]
+
+This requests the <number of messages> of a <Message Size (default 4096
bytes>. By default the connection is Non Persistent and Non Transactional.
+
+After receiving all the messages the client outputs the rate it achieved.
+
+
+Ping-Pong
+---------
+
+
+
+
+Headers
+-------
+
+
+A more realistic test is the "headers test", which tests the
+performance of routing messages based on message headers to a
+configurable number of clients (e.g. 50). A publisher sends 10000
+messages to each client and waits to receive a message from each
+client when it has received all the messages.
+
+You run the listener processes first:
+
+run_many.sh 10 header "headersListener.sh -host 10.0.0.1 -port 5672"
+
+In this command, the first argument means start 10 processes, the
+second is just a name use in the log files generated and the third
+argument is the command to run. In this case it runs another shell
+script but it could be anything.
+
+Then run the publisher process:
+
+headersPublisher.sh -host 10.0.0.1 -port 5672 10000 10
+
+The last two arguments are: the number of messages to send to each
+client, and the number of clients.
+
+Note that before starting the publisher you should wait about 30
+seconds to ensure all the clients are registered with the broker (you
+can see this from the broker output). Otherwise the numbers will be
+slightly skewed.
+
+A third useful test, which can easily be ported to other JMS
+implementations is the "topic test". It does the same as the headers
+test but using a standard topic (e.g. pub sub).
+
+To run the listeners:
+
+run_many.sh 10 topic "topicListener.sh -host 10.0.0.1 -port 5672"
+
+and to run the publisher:
+
+topicPublisher.sh -host 10.0.0.1 -port 5672 -clients 10 -messages 10000
\ No newline at end of file
Propchange: incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/qpid/trunk/qpid/java/perftests/RunningPerformanceTests.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: incubator/qpid/trunk/qpid/java/perftests/bin/serviceProvidingClient.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/serviceProvidingClient.sh?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/serviceProvidingClient.sh
(original)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/serviceProvidingClient.sh Fri
Jan 12 03:10:48 2007
@@ -17,15 +17,17 @@
# specific language governing permissions and limitations
# under the License.
#
-
-# XXX -Xms1024m -XX:NewSize=300m
+# args supplied: <brokerdetails> <num messages>
if [[ $# != 1 ]] ; then
- echo "usage: ./serviceProvidingClient.sh <brokerdetails>"
+ echo "usage: ./serviceProvidingClient.sh <brokerdetails>
[<P[ersistent]|N[onPersistent] (default N)> <T[ransacted]|N[onTransacted]
(default N)>] [selector]"
exit 1
fi
+thehosts=$1
+shift
+
. ./setupclasspath.sh
echo $CP
-# usage: just pass in the host(s)
-$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=perftests.log4j
org.apache.qpid.requestreply.ServiceProvidingClient $1 guest guest /test
serviceQ P T
+
+$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=src/perftests.log4j
org.apache.qpid.requestreply.ServiceProvidingClient $thehosts guest guest /test
serviceQ "$@"
Added:
incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestReply-QuickTest.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestReply-QuickTest.sh?view=auto&rev=495554
==============================================================================
---
incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestReply-QuickTest.sh
(added)
+++
incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestReply-QuickTest.sh
Fri Jan 12 03:10:48 2007
@@ -0,0 +1,43 @@
+#!/bin/bash
+#
+# 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 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# args supplied: <brokerdetails> <num messages>
+
+if [[ $# != 2 ]] ; then
+ echo "usage: ./serviceQuickTest.sh <brokerdetails> <Number of messages>
[<P[ersistent]|N[onPersistent] (default N)> <T[ransacted]|N[onTransacted]
(default N)>]"
+ exit 1
+fi
+
+thehosts=$1
+shift
+
+numberofmessages=$1
+shift
+
+. ./setupclasspath.sh
+echo $CP
+
+$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=src/perftests.log4j
org.apache.qpid.requestreply.ServiceProvidingClient $thehosts guest guest /test
serviceQ "$@" &
+
+providingclient=$!
+
+$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=src/perftests.log4j
org.apache.qpid.requestreply.ServiceRequestingClient $thehosts guest guest
/test serviceQ $numberofmessages "$@"
+
+kill $providingclient
+
Propchange:
incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestReply-QuickTest.sh
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestReply-QuickTest.sh
------------------------------------------------------------------------------
svn:executable = *
Modified:
incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestingClient.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestingClient.sh?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestingClient.sh
(original)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/serviceRequestingClient.sh Fri
Jan 12 03:10:48 2007
@@ -17,17 +17,18 @@
# specific language governing permissions and limitations
# under the License.
#
-# args supplied: <host:port> <num messages>
-#
+# usage: ./serviceRequestingClient.sh <brokerdetails> <number of messages>
[<message size 4096b default>] [<P[ersistent]|N[onPersistent]>
<T[ransacted]|N[onTransacted]>]
+
if [[ $# < 2 ]] ; then
- echo "usage: ./serviceRequestingClient.sh <brokerdetails> <number of
messages> [<message size 4096b default>]"
+ echo "usage: ./serviceRequestingClient.sh <brokerdetails> <number of
messages> [<message size 4096b default>] [<P[ersistent]|N[onPersistent]>
<T[ransacted]|N[onTransacted]>]"
exit 1
fi
thehosts=$1
shift
-echo $thehosts
+
# XXX -Xms1024m -XX:NewSize=300m
. ./setupclasspath.sh
echo $CP
-$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Dlog.dir="$QPID_HOME/logs" -Damqj.test.logging.level="info"
-Dlog4j.configuration=perftests.log4j
org.apache.qpid.requestreply.ServiceRequestingClient $thehosts guest guest
/test serviceQ P T "$@"
+
+$JAVA_HOME/bin/java -cp $CP -Dlog.dir="$QPID_HOME/logs"
-Damqj.logging.level="warn" -Damqj.test.logging.level="info"
-Dlog4j.configuration=src/perftests.log4j
org.apache.qpid.requestreply.ServiceRequestingClient $thehosts guest guest
/test serviceQ "$@"
Modified: incubator/qpid/trunk/qpid/java/perftests/bin/testPingClient.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/testPingClient.sh?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/testPingClient.sh (original)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/testPingClient.sh Fri Jan 12
03:10:48 2007
@@ -30,4 +30,4 @@
# XXX -Xms1024m -XX:NewSize=300m
. ./setupclasspath.sh
echo $CP
-$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=perftests.log4j
org.apache.qpid.pingpong.TestPingClient $thehosts guest guest /test "$@"
+$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=src/perftests.log4j
org.apache.qpid.pingpong.TestPingClient $thehosts guest guest /test "$@"
Modified: incubator/qpid/trunk/qpid/java/perftests/bin/testPingProducer.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/testPingProducer.sh?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/testPingProducer.sh (original)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/testPingProducer.sh Fri Jan 12
03:10:48 2007
@@ -30,4 +30,4 @@
# XXX -Xms1024m -XX:NewSize=300m
. ./setupclasspath.sh
echo $CP
-$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=perftests.log4j
org.apache.qpid.pingpong.TestPingProducer $thehosts /test
+$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=src/perftests.log4j
org.apache.qpid.pingpong.TestPingProducer $thehosts /test
Modified: incubator/qpid/trunk/qpid/java/perftests/bin/testPingPublisher.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/testPingPublisher.sh?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/testPingPublisher.sh (original)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/testPingPublisher.sh Fri Jan
12 03:10:48 2007
@@ -30,4 +30,4 @@
# XXX -Xms1024m -XX:NewSize=300m
. ./setupclasspath.sh
echo $CP
-$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=perftests.log4j
org.apache.qpid.pingpong.TestPingPublisher $thehosts /test
+$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="info" -Dlog4j.configuration=src/perftests.log4j
org.apache.qpid.pingpong.TestPingPublisher $thehosts /test
Modified: incubator/qpid/trunk/qpid/java/perftests/bin/testPingSubscriber.sh
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/bin/testPingSubscriber.sh?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/bin/testPingSubscriber.sh
(original)
+++ incubator/qpid/trunk/qpid/java/perftests/bin/testPingSubscriber.sh Fri Jan
12 03:10:48 2007
@@ -30,4 +30,4 @@
# XXX -Xms1024m -XX:NewSize=300m
. ./setupclasspath.sh
echo $CP
-$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="debug" -Dlog4j.configuration=perftests.log4j
org.apache.qpid.pingpong.TestPingSubscriber $thehosts guest guest /test "$@"
+$JAVA_HOME/bin/java -cp $CP -Damqj.logging.level="warn"
-Damqj.test.logging.level="debug" -Dlog4j.configuration=src/perftests.log4j
org.apache.qpid.pingpong.TestPingSubscriber $thehosts guest guest /test "$@"
Modified: incubator/qpid/trunk/qpid/java/perftests/distribution/pom.xml
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/distribution/pom.xml?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/distribution/pom.xml (original)
+++ incubator/qpid/trunk/qpid/java/perftests/distribution/pom.xml Fri Jan 12
03:10:48 2007
@@ -64,6 +64,9 @@
<artifactId>maven-assembly-plugin</artifactId>
<version>${assembly.version}</version>
<configuration>
+ <descriptors>
+
<descriptor>src/main/assembly/performance.xml</descriptor>
+ </descriptors>
<finalName>qpid-${pom.version}</finalName>
<outputDirectory>${qpid.targetDir}</outputDirectory>
<tarLongFileMode>gnu</tarLongFileMode>
Modified:
incubator/qpid/trunk/qpid/java/perftests/distribution/src/main/assembly/performance.xml
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/distribution/src/main/assembly/performance.xml?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
---
incubator/qpid/trunk/qpid/java/perftests/distribution/src/main/assembly/performance.xml
(original)
+++
incubator/qpid/trunk/qpid/java/perftests/distribution/src/main/assembly/performance.xml
Fri Jan 12 03:10:48 2007
@@ -26,6 +26,7 @@
</formats>
<fileSets>
+ <!-- Apache Licensing -->
<fileSet>
<directory>../../resources</directory>
<outputDirectory>qpid-${qpid.version}</outputDirectory>
@@ -36,20 +37,25 @@
<include>README.txt</include>
</includes>
</fileSet>
+
<fileSet>
- <directory>..</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
+ <directory>../../release-docs</directory>
+ <outputDirectory>qpid-${qpid.version}/docs</outputDirectory>
<includes>
- <include>*.txt</include>
+ <include>RELEASE_NOTES.txt</include>
</includes>
</fileSet>
+
+ <!-- Performance txt files-->
<fileSet>
- <directory>../../release-docs</directory>
- <outputDirectory>qpid-${qpid.version}/docs</outputDirectory>
+ <directory>..</directory>
+ <outputDirectory>qpid-${qpid.version}</outputDirectory>
<includes>
- <include>RELEASE_NOTES.txt</include>
+ <include>*.txt</include>
</includes>
</fileSet>
+
+ <!-- Execution Scripts -->
<fileSet>
<directory>../bin</directory>
<outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
@@ -57,6 +63,8 @@
<include>*</include>
</includes>
</fileSet>
+
+ <!-- Provide Source in easy access location -->
<fileSet>
<directory>../src/main</directory>
<outputDirectory>qpid-${qpid.version}/src</outputDirectory>
@@ -66,6 +74,7 @@
</includes>
</fileSet>
+ <!-- Metadata Jar -->
<fileSet>
<directory>target</directory>
<outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
Modified:
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
---
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java
(original)
+++
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceProvidingClient.java
Fri Jan 12 03:10:48 2007
@@ -49,13 +49,13 @@
public ServiceProvidingClient(String brokerDetails, String username,
String password,
String clientName, String virtualPath,
String serviceName,
- String
deliveryModeString, String transactedMode)
+ final int deliveryMode, boolean
transactedMode, String selector)
throws AMQException, JMSException, URLSyntaxException
{
- final int deliveryMode =
deliveryModeString.toUpperCase().charAt(0) == 'P' ? DeliveryMode.PERSISTENT :
DeliveryMode.NON_PERSISTENT;
- _isTransactional = transactedMode.toUpperCase().charAt(0) ==
'T' ? true : false;
+ _isTransactional = transactedMode;
- _logger.info("Delivery Mode: " + deliveryMode + "\t isTransactional: "
+ _isTransactional);
+ _logger.info("Delivery Mode: " + (deliveryMode ==
DeliveryMode.NON_PERSISTENT ? "Non Persistent" : "Persistent")
+ + "\t isTransactional: " + _isTransactional);
_connection = new AMQConnection(brokerDetails, username, password,
clientName, virtualPath);
@@ -93,7 +93,7 @@
AMQQueue destination = new AMQQueue(serviceName);
MessageConsumer consumer = _session.createConsumer(destination,
- 100, true, false,
null);
+ 100, true, false,
selector);
consumer.setMessageListener(new MessageListener()
{
@@ -153,11 +153,11 @@
_destinationProducer.send(msg);
- if(_isTransactional)
+ if (_isTransactional)
{
_producerSession.commit();
}
- if(_isTransactional)
+ if (_isTransactional)
{
_session.commit();
}
@@ -184,10 +184,9 @@
{
_logger.info("Starting...");
- if (args.length < 7)
+ if (args.length < 5)
{
- System.out.println("Usage: <brokerDetails> <username> <password>
<virtual-path> <serviceQueue>" +
- " <P[ersistent]|N[onPersistent]>
<T[ransacted]|N[onTransacted]> [selector]");
+ System.out.println("Usage: serviceProvidingClient <brokerDetails>
<username> <password> <virtual-path> <serviceQueue>
[<P[ersistent]|N[onPersistent]> <T[ransacted]|N[onTransacted]>] [selector]");
System.exit(1);
}
String clientId = null;
@@ -201,10 +200,29 @@
_logger.error("Error: " + e, e);
}
+
+ int deliveryMode = DeliveryMode.NON_PERSISTENT;
+ boolean transactedMode = false;
+
+ if (args.length > 7)
+ {
+ deliveryMode = args[args.length - 2].toUpperCase().charAt(0) ==
'P' ? DeliveryMode.PERSISTENT
+ : DeliveryMode.NON_PERSISTENT;
+
+ transactedMode = args[args.length - 1].toUpperCase().charAt(0) ==
'T' ? true : false;
+ }
+
+ String selector = null;
+ if ((args.length == 8) || (args.length == 7))
+ {
+ selector = args[args.length - 1];
+ }
+
try
{
ServiceProvidingClient client = new
ServiceProvidingClient(args[0], args[1], args[2],
-
clientId, args[3], args[4], args[5], args[6]);
+
clientId, args[3], args[4],
+
deliveryMode, transactedMode, selector);
client.run();
}
catch (JMSException e)
@@ -219,6 +237,8 @@
{
_logger.error("Error: " + e, e);
}
+
+
}
}
Modified:
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
---
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java
(original)
+++
incubator/qpid/trunk/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/ServiceRequestingClient.java
Fri Jan 12 03:10:48 2007
@@ -91,7 +91,7 @@
}
try
{
- m.getPropertyNames();
+ m.getPropertyNames();
if (m.propertyExists("timeSent"))
{
long timeSent =
Long.parseLong(m.getStringProperty("timeSent"));
@@ -162,15 +162,13 @@
public ServiceRequestingClient(String brokerHosts, String clientID, String
username, String password,
String vpath, String commandQueueName,
- String
deliveryModeString, String transactedMode,
+ int deliveryMode, boolean transactedMode,
final int messageCount, final int
messageDataLength) throws AMQException, URLSyntaxException
{
- final int deliveryMode =
deliveryModeString.toUpperCase().charAt(0) == 'P' ? DeliveryMode.PERSISTENT
-
:
DeliveryMode.NON_PERSISTENT;
+ _isTransactional = transactedMode;
- _isTransactional = transactedMode.toUpperCase().charAt(0) ==
'T' ? true : false;
-
- _log.info("Delivery Mode: " + deliveryMode + "\t isTransactional: " +
_isTransactional);
+ _log.info("Delivery Mode: " + (deliveryMode ==
DeliveryMode.NON_PERSISTENT ? "Non Persistent" : "Persistent") +
+ "\t isTransactional: " + _isTransactional);
_messageCount = messageCount;
MESSAGE_DATA =
TestMessageFactory.createMessagePayload(messageDataLength);
@@ -198,7 +196,7 @@
TextMessage first = _session.createTextMessage(MESSAGE_DATA);
first.setJMSReplyTo(_tempDestination);
send(first);
- if(_isTransactional)
+ if (_isTransactional)
{
_producerSession.commit();
}
@@ -248,7 +246,7 @@
msg.setLongProperty("timeSent", timeNow);
}
send(msg);
- if(_isTransactional)
+ if (_isTransactional)
{
_producerSession.commit();
}
@@ -275,22 +273,36 @@
*/
public static void main(String[] args)
{
- if (args.length < 9)
+ if (args.length < 6)
{
- System.err.println("Usage: ServiceRequestingClient <brokerDetails
- semicolon separated host:port list>" +
- " <username> <password> <vpath> <command queue
name> <P[ersistent]|N[onPersistent]>" +
- " <T[ransacted]|N[onTransacted]> <number of
messages> <message size>");
+ System.err.println(
+ "Usage: ServiceRequestingClient <brokerDetails> <username>
<password> <vpath> <command queue name> <number of messages> [<message size>]
[<P[ersistent]|N[onPersistent] (Default N)> <T[ransacted]|N[onTransacted]
(Default N)>]");
System.exit(1);
}
try
{
- int messageDataLength = args.length > 8 ?
Integer.parseInt(args[8]) : 4096;
+ int messageSize = 4096;
+ boolean transactedMode = false;
+ int deliveryMode = DeliveryMode.NON_PERSISTENT;
+
+ if (args.length > 7)
+ {
+ deliveryMode = args[args.length - 2].toUpperCase().charAt(0)
== 'P' ? DeliveryMode.PERSISTENT
+ : DeliveryMode.NON_PERSISTENT;
+
+ transactedMode = args[args.length - 1].toUpperCase().charAt(0)
== 'T' ? true : false;
+ }
+
+ if ((args.length == 9) ||(args.length == 7))
+ {
+ messageSize = Integer.parseInt(args[6]);
+ }
InetAddress address = InetAddress.getLocalHost();
String clientID = address.getHostName() +
System.currentTimeMillis();
ServiceRequestingClient client = new
ServiceRequestingClient(args[0], clientID, args[1], args[2], args[3],
-
args[4], args[5], args[6], Integer.parseInt(args[7]),
-
messageDataLength);
+
args[4], deliveryMode, transactedMode, Integer.parseInt(args[5]),
+
messageSize);
Object waiter = new Object();
client.run(waiter);
synchronized (waiter)
Modified: incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j?view=diff&rev=495554&r1=495553&r2=495554
==============================================================================
--- incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j
(original)
+++ incubator/qpid/trunk/qpid/java/perftests/src/main/java/perftests.log4j Fri
Jan 12 03:10:48 2007
@@ -28,7 +28,9 @@
log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.Threshold=all
log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
+
+#log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
+log4j.appender.console.layout.ConversionPattern=[%c] %m%n
log4j.appender.fileApp=org.apache.log4j.FileAppender
log4j.appender.fileApp.file=${log.dir}/perftests.volumetest.log