nevado-jms/src/main/java/org/skyscreamer/nevado/jms/performance/PerformanceService.java
/**
     * <p>Run a sample of messages, testing for performance.</p>
     * <code>Total # of messages = numMessages X numThreads</code>
     *
     * @param connection Connection to use for creating temporary queues, and sending/receiving messages
     * @param numMessages Number of messages to send on each thread
     * @param messageSize Size of message payload (max 48k)
     * @param numThreads Number of threads to create for sending and receiving
     * @param messageSendDelayMs Delay time between sending each message.  Added to total send time.  Recommended 0.
     * @return A result object containing the details of the performance run
     * @throws JMSException A JMS exception was encountered during the run
     * @throws InterruptedException One or more threads was interrupted during the run
     */
Run a sample of messages, testing for performance.
Total # of messages = numMessages X numThreads


Run a sample of messages testing for performance . Total # of messages = numMessages X numThreads
public PerformanceResult runSample(Connection connection, int numMessages, int messageSize,
                                       int numThreads, long messageSendDelayMs)
            throws JMSException, InterruptedException
    {
        Session[] sessions = new Session[numThreads];
        Queue[] queues = new Queue[numThreads];
        initializeSessionsAndQueues(connection, sessions, queues, numThreads);
        long sendTime = sendMessages(numMessages, messageSize, numThreads, messageSendDelayMs, sessions, queues);
        PerformanceTally tally = new PerformanceTally();
        long receiveTime = receiveMessages(numMessages, numThreads, sessions, queues, tally);
        PerformanceResult result = new PerformanceResult(numMessages * numThreads, tally, messageSize, numThreads,
                sendTime, receiveTime);
        return result;
    }
public PerformanceResult runSample ( Connection connection , int numMessages , int messageSize , int numThreads , long messageSendDelayMs ) throws JMSException , InterruptedException { Session [ ] sessions = new Session [ numThreads ] ; Queue [ ] queues = new Queue [ numThreads ] ; initializeSessionsAndQueues ( connection , sessions , queues , numThreads ) ; long sendTime = sendMessages ( numMessages , messageSize , numThreads , messageSendDelayMs , sessions , queues ) ; PerformanceTally tally = new PerformanceTally ( ) ; long receiveTime = receiveMessages ( numMessages , numThreads , sessions , queues , tally ) ; PerformanceResult result = new PerformanceResult ( numMessages * numThreads , tally , messageSize , numThreads , sendTime , receiveTime ) ; return result ; }
<p>Run a sample of messages, testing for performance.</p>
 <code>Total # of messages = numMessages X numThreads</code>
<p > Run a sample of messages testing for performance . < / p > <code > Total # of messages = numMessages X numThreads< / code >