org.apache.qpid.tools
Class LatencyTest
java.lang.Object
org.apache.qpid.tools.PerfBase
org.apache.qpid.tools.LatencyTest
- All Implemented Interfaces:
- MessageListener
public class LatencyTest
- extends PerfBase
- implements MessageListener
Latency test sends an x number of messages in warmup mode and wait for a confirmation
from the consumer that it has successfully consumed them and ready to start the
test. It will start sending y number of messages and each message will contain a time
stamp. This will be used at the receiving end to measure the latency.
It is important to have a sufficiently large number for the warmup count to
ensure the system is in steady state before the test is started.
If you plan to plot the latencies then msg_count should be a smaller number (ex 500 or 1000)
You also need to specify a file name using -Dfile=/home/rajith/latency.log.1
The idea is to get a latency sample for the system once it achieves steady state.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
producer
MessageProducer producer
consumer
MessageConsumer consumer
msg
Message msg
payload
byte[] payload
maxLatency
long maxLatency
minLatency
long minLatency
totalLatency
long totalLatency
rcvdMsgCount
int rcvdMsgCount
stdDev
double stdDev
avgLatency
double avgLatency
warmup_mode
boolean warmup_mode
transacted
boolean transacted
transSize
int transSize
latencies
final List<Long> latencies
lock
final Lock lock
warmedUp
final Condition warmedUp
testCompleted
final Condition testCompleted
LatencyTest
public LatencyTest()
setUp
public void setUp()
throws Exception
- Overrides:
setUp
in class PerfBase
- Throws:
Exception
getNextMessage
protected Message getNextMessage()
throws Exception
- Throws:
Exception
warmup
public void warmup()
throws Exception
- Throws:
Exception
onMessage
public void onMessage(Message msg)
- Specified by:
onMessage
in interface MessageListener
writeToFile
public void writeToFile()
throws Exception
- Throws:
Exception
printToConsole
public void printToConsole()
startTest
public void startTest()
throws Exception
- Throws:
Exception
tearDown
public void tearDown()
throws Exception
- Throws:
Exception
test
public void test()
main
public static void main(String[] args)
Licensed to the Apache Software Foundation