long totalTimeTaken = results[1].getTestTime() + results[1].getInitTime() - results[0].getInitTime();
long totalTimeTaken = results[1].testTime + results[1].initTime - results[0].testTime;
   public void testMessageSizeThroughput()   {      log.info("Running test testMessageSizeThroughput");            warmupDestination(topicName, standardMessageSize, false, DeliveryMode.NON_PERSISTENT, Session.AUTO_ACKNOWLEDGE);                  Execution execution = createExecution("MessageSizeThroughput");            //int[] msgsSize = new int[] {0, standardMessageSize, 16384, 65536, 262144, 1048576, 8388608};            int[] msgsSize = new int[] {0, 8192, 16384, 32768, 65536};            for (int i = 0; i < msgsSize.length; i++)      {                 int msgSize = msgsSize[i];                  log.trace("Doing message size " + msgSize);                        SenderJob sender = createDefaultSenderJob(topicName);         sender.setNumMessages(numMessages);         sender.setMsgSize(msgSize);         sender.setMf(new BytesMessageMessageFactory());         sender.setTransacted(false);         sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);         sender.setInitialPause(initialPause); //enough time for receiver to get ready         sender.setSlaveURL(slaveURLs[0]);                  ReceiverJob receiver = createDefaultReceiverJob(topicName);                  receiver.setAckMode(Session.AUTO_ACKNOWLEDGE);         receiver.setTransacted(false);         receiver.setNumMessages(numMessages);         receiver.setSlaveURL(slaveURLs[1]);                  JobTimings[] results = runJobs(new Job[] {sender, receiver});                  /*          * NB.          * When we calculating the total time taken from first send to last receive, there is some          * error involved due to the differences in network latency and other remoting overhead          * when sending the jobs to be executed on potentially different remote machines.          * We make the assumption that this this difference is very small compared with time taken          * to run the tests as to be negligible.          */                  long totalTimeTaken = results[1].getTestTime() + results[1].getInitTime() - results[0].getInitTime();                  Measurement measure = new Measurement("throughput", 1000 * (double)numMessages / totalTimeTaken);         measure.setVariableValue("messageSize", msgSize);         execution.addMeasurement(measure);                        }            pm.saveExecution(execution);                  log.info("Test testMessageSizeThroughput finished");   }