org.apache.qpid.tools
Class PerfProducer
java.lang.Object
org.apache.qpid.tools.PerfBase
org.apache.qpid.tools.PerfProducer
public class PerfProducer
- extends PerfBase
PerfProducer sends an x no 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 no of messages and each message will contain a time
stamp. This will be used at the receiving end to measure the latency.
This is done with the assumption that both consumer and producer are running on
the same machine or different machines which have time synced using a time server.
This test also calculates the producer rate as follows.
rate = msg_count/(time_before_sending_msgs - time_after_sending_msgs)
All throughput rates are given as msg/sec so the rates are multiplied by 1000.
Rajith - Producer rate is not an accurate perf metric IMO.
It is heavily inlfuenced by any in memory buffering.
System throughput and latencies calculated by the PerfConsumer are more realistic
numbers.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
producer
MessageProducer producer
msg
Message msg
payload
byte[] payload
payloads
List<byte[]> payloads
cacheMsg
boolean cacheMsg
randomMsgSize
boolean randomMsgSize
durable
boolean durable
random
Random random
msgSizeRange
int msgSizeRange
PerfProducer
public PerfProducer()
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
startTest
public void startTest()
throws Exception
- Throws:
Exception
waitForCompletion
public void waitForCompletion()
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