org.apache.qpid.tools
Class PerfProducer

java.lang.Object
  extended by org.apache.qpid.tools.PerfBase
      extended by 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.


Field Summary
(package private)  boolean cacheMsg
           
(package private)  boolean durable
           
(package private)  Message msg
           
(package private)  int msgSizeRange
           
(package private)  byte[] payload
           
(package private)  List<byte[]> payloads
           
(package private)  MessageProducer producer
           
(package private)  Random random
           
(package private)  boolean randomMsgSize
           
 
Fields inherited from class org.apache.qpid.tools.PerfBase
con, dest, df, feedbackDest, params, session
 
Constructor Summary
PerfProducer()
           
 
Method Summary
protected  Message getNextMessage()
           
static void main(String[] args)
           
 void setUp()
           
 void startTest()
           
 void tearDown()
           
 void test()
           
 void waitForCompletion()
           
 void warmup()
           
 
Methods inherited from class org.apache.qpid.tools.PerfBase
handleError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

PerfProducer

public PerfProducer()
Method Detail

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