org.apache.qpid.tools
Class LatencyTest

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


Field Summary
(package private)  double avgLatency
           
(package private)  MessageConsumer consumer
           
(package private)  List<Long> latencies
           
(package private)  Lock lock
           
(package private)  long maxLatency
           
(package private)  long minLatency
           
(package private)  Message msg
           
(package private)  byte[] payload
           
(package private)  MessageProducer producer
           
(package private)  int rcvdMsgCount
           
(package private)  double stdDev
           
(package private)  Condition testCompleted
           
(package private)  long totalLatency
           
(package private)  boolean transacted
           
(package private)  int transSize
           
(package private)  Condition warmedUp
           
(package private)  boolean warmup_mode
           
 
Fields inherited from class org.apache.qpid.tools.PerfBase
con, dest, df, feedbackDest, params, session
 
Constructor Summary
LatencyTest()
           
 
Method Summary
protected  Message getNextMessage()
           
static void main(String[] args)
           
 void onMessage(Message msg)
           
 void printToConsole()
           
 void setUp()
           
 void startTest()
           
 void tearDown()
           
 void test()
           
 void warmup()
           
 void writeToFile()
           
 
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

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

LatencyTest

public LatencyTest()
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

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