diff options
| author | Bhupendra Bhusman Bhardwaj <bhupendrab@apache.org> | 2007-02-26 14:36:15 +0000 |
|---|---|---|
| committer | Bhupendra Bhusman Bhardwaj <bhupendrab@apache.org> | 2007-02-26 14:36:15 +0000 |
| commit | f49170eb2d35657e50f92b2e318503b5ec4f41e3 (patch) | |
| tree | f46d79b766975ed52758dc3a83c5b3cfecba3394 /qpid/java/perftests/src/main | |
| parent | 8be3451d157a60d8e979ea643d76186e46bbb901 (diff) | |
| download | qpid-python-f49170eb2d35657e50f92b2e318503b5ec4f41e3.tar.gz | |
QPID-388 (option to provide ack mode for tests)
changed config to include latest junit-toolkit snapshot (to get more results info in case of failure)
changed the generation of unique ping destination to enable parallel tests in different JVM
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/perftesting@511821 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/perftests/src/main')
| -rw-r--r-- | qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java | 6 | ||||
| -rw-r--r-- | qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java | 31 |
2 files changed, 24 insertions, 13 deletions
diff --git a/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java b/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java index a52b5a0c49..2a384c5a84 100644 --- a/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java +++ b/qpid/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java @@ -73,11 +73,12 @@ public class PingClient extends PingPongProducer public PingClient(String brokerDetails, String username, String password, String virtualpath, String destinationName, String selector, boolean transacted, boolean persistent, int messageSize, boolean verbose, boolean afterCommit, boolean beforeCommit, boolean afterSend, boolean beforeSend, boolean failOnce, - int txBatchSize, int noOfDestinations, int rate, boolean pubsub, boolean unique) throws Exception + int txBatchSize, int noOfDestinations, int rate, boolean pubsub, boolean unique, + int ackMode) throws Exception { super(brokerDetails, username, password, virtualpath, destinationName, selector, transacted, persistent, messageSize, verbose, afterCommit, beforeCommit, afterSend, beforeSend, failOnce, txBatchSize, noOfDestinations, rate, - pubsub, unique); + pubsub, unique, ackMode); _pingClientCount++; } @@ -104,5 +105,4 @@ public class PingClient extends PingPongProducer return _pingClientCount; } } - } diff --git a/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java b/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java index 6f444bd290..ce581a6582 100644 --- a/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java +++ b/qpid/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java @@ -144,6 +144,8 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis public static final String UNIQUE_PROPNAME = "uniqueDests"; + public static final String ACK_MODE_PROPNAME = "ackMode"; + /** Used to set up a default message size. */ public static final int DEFAULT_MESSAGE_SIZE = 0; @@ -218,6 +220,8 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis public static final boolean DEFAULT_UNIQUE = true; + public static final int DEFAULT_ACK_MODE = Session.NO_ACKNOWLEDGE; + /** Holds the name of the property to store nanosecond timestamps in ping messages with. */ public static final String MESSAGE_TIMESTAMP_PROPNAME = "timestamp"; @@ -248,6 +252,8 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis /** Determines whether this producer sends persistent messages. */ protected boolean _persistent; + private int _ackMode = Session.NO_ACKNOWLEDGE; + /** Determines what size of messages this producer sends. */ protected int _messageSize; @@ -347,7 +353,7 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis String destinationName, String selector, boolean transacted, boolean persistent, int messageSize, boolean verbose, boolean afterCommit, boolean beforeCommit, boolean afterSend, boolean beforeSend, boolean failOnce, int txBatchSize, int noOfDestinations, int rate, - boolean pubsub, boolean unique) throws Exception + boolean pubsub, boolean unique, int ackMode) throws Exception { _logger.debug("public PingPongProducer(String brokerDetails = " + brokerDetails + ", String username = " + username + ", String password = " + password + ", String virtualpath = " + virtualpath @@ -357,7 +363,8 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis + afterCommit + ", boolean beforeCommit = " + beforeCommit + ", boolean afterSend = " + afterSend + ", boolean beforeSend = " + beforeSend + ", boolean failOnce = " + failOnce + ", int txBatchSize = " + txBatchSize + ", int noOfDestinations = " + noOfDestinations + ", int rate = " + rate - + ", boolean pubsub = " + pubsub + ", boolean unique = " + unique + "): called"); + + ", boolean pubsub = " + pubsub + ", boolean unique = " + unique + + ", ackMode = " + ackMode + "): called"); // Keep all the relevant options. _persistent = persistent; @@ -371,6 +378,10 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis _txBatchSize = txBatchSize; _isPubSub = pubsub; _isUnique = unique; + if (ackMode != 0) + { + _ackMode = ackMode; + } // Check that one or more destinations were specified. if (noOfDestinations < 1) @@ -385,8 +396,8 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis _connection = new AMQConnection(brokerDetails, username, password, clientID, virtualpath); // Create transactional or non-transactional sessions, based on the command line arguments. - _producerSession = (Session) getConnection().createSession(transacted, Session.AUTO_ACKNOWLEDGE); - _consumerSession = (Session) getConnection().createSession(transacted, Session.AUTO_ACKNOWLEDGE); + _producerSession = (Session) getConnection().createSession(transacted, _ackMode); + _consumerSession = (Session) getConnection().createSession(transacted, _ackMode); // Set up a throttle to control the send rate, if a rate > 0 is specified. if (rate > 0) @@ -484,7 +495,7 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis PingPongProducer pingProducer = new PingPongProducer(brokerDetails, DEFAULT_USERNAME, DEFAULT_PASSWORD, virtualpath, destName, selector, transacted, persistent, messageSize, verbose, afterCommit, beforeCommit, afterSend, - beforeSend, failOnce, batchSize, destCount, rate, pubsub, false); + beforeSend, failOnce, batchSize, destCount, rate, pubsub, false, 0); pingProducer.getConnection().start(); @@ -574,31 +585,31 @@ public class PingPongProducer implements Runnable, MessageListener, ExceptionLis { AMQDestination destination; - int id; + String id; // Generate an id, unique within this pinger or to the whole JVM depending on the unique flag. if (unique) { _logger.debug("Creating unique destinations."); - id = _queueJVMSequenceID.incrementAndGet(); + id = "_" + _queueJVMSequenceID.incrementAndGet() + "_" + _connection.getClientID(); } else { _logger.debug("Creating shared destinations."); - id = _queueSharedId.incrementAndGet(); + id = "_" + _queueSharedId.incrementAndGet(); } // Check if this is a pub/sub pinger, in which case create topics. if (_isPubSub) { - _logger.debug("Creating topics."); destination = new AMQTopic(rootName + id); + _logger.debug("Creating topic " + destination); } // Otherwise this is a p2p pinger, in which case create queues. else { - _logger.debug("Creating queues."); destination = new AMQQueue(rootName + id); + _logger.debug("Creating queue " + destination); } // Keep the destination. |
