Added better weighted sleeps to make sure everything is going before we start sampling.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@631662 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2008-02-27 17:44:07 +00:00
parent a9120b1b12
commit b01374e05f
1 changed files with 9 additions and 2 deletions

View File

@ -123,8 +123,11 @@ public class NetworkLoadTest extends TestCase {
brokers[i] = createBroker(i); brokers[i] = createBroker(i);
brokers[i].start(); brokers[i].start();
} }
// Wait for the brokers to finish starting up and establish thier network connections.
Thread.sleep(BROKER_COUNT*400); // Wait for the network connection to get setup.
// The wait is exponential since every broker has to connect to every other broker.
Thread.sleep(BROKER_COUNT*BROKER_COUNT*50);
forwardingClients = new ForwardingClient[BROKER_COUNT-1]; forwardingClients = new ForwardingClient[BROKER_COUNT-1];
for (int i = 0; i < forwardingClients.length; i++) { for (int i = 0; i < forwardingClients.length; i++) {
LOG.info("Starting fowarding client "+i); LOG.info("Starting fowarding client "+i);
@ -259,6 +262,10 @@ public class NetworkLoadTest extends TestCase {
}; };
producer.start(); producer.start();
// Give the forwarding clients a chance to get going and fill the down stream broker queues..
Thread.sleep(BROKER_COUNT*200);
for (int i = 0; i < SAMPLES; i++) { for (int i = 0; i < SAMPLES; i++) {
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();