public class MercuryConsumerController
extends MercuryBase
PerfConsumer will receive x no of messages in warmup mode.
Once it receives the Start message it will then signal the PerfProducer.
It will start recording stats from the first message it receives after
the warmup mode is done.
The following calculations are done.
The important numbers to look at is
a) Avg Latency
b) System throughput.
Latency.
=========
Currently this test is written with the assumption that either
a) The Perf Producer and Consumer are on the same machine
b) They are on separate machines that have their time synced via a Time Server
In order to calculate latency the producer inserts a timestamp
when the message is sent. The consumer will note the current time the message is
received and will calculate the latency as follows
latency = rcvdTime - msg.getJMSTimestamp()
Through out the test it will keep track of the max and min latency to show the
variance in latencies.
Avg latency is measured by adding all latencies and dividing by the total msgs.
Throughput
===========
Consumer rate is calculated as
rcvdMsgCount/(rcvdTime - startTime)
Note that the testStartTime referes to when the producer sent the first message
and startTime is when the consumer first received a message.
rcvdTime keeps track of when the last message is received.
All throughput rates are given as msg/sec so the rates are multiplied by 1000.