Package org.jgroups.tests
Class RoundTrip
java.lang.Object
org.jgroups.tests.RoundTrip
- All Implemented Interfaces:
RtReceiver
Class that measure RTT for multicast messages between 2 cluster members. See
RpcDispatcherSpeedTest for
RPCs. Note that request and response times are measured using System.nanoTime() which might yield incorrect
values when run on different cores, so these numbers may not be reliable.Running this on different nodes will not yield correct results for request- and response-latencies, but should be ok for round-trip times. *If* times across nodes are synchronized, flag -use-wall-clock can switch to currentTimeMillis() which gives more meaningful results for request- and response-latency across boxes.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected static final byteprotected intprotected intstatic final intprotected static final byteprotected final AverageMinMaxprotected static final byteprotected final AverageMinMaxprotected RoundTrip.Sender[]protected RtTransportprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Stringprotected static RtTransportprotected static voidprotected voidloop()static voidprotected Stringprint(AverageMinMax avg) protected static StringprintOptions(String[] opts) voidOn the server: receive a request, send a response.protected voidprotected voidprotected static longtime(boolean use_ms) protected Stringunit()
-
Field Details
-
tp
-
num_msgs
protected int num_msgs -
num_senders
protected int num_senders -
details
protected boolean details -
use_ms
protected boolean use_ms -
REQ
protected static final byte REQ- See Also:
-
RSP
protected static final byte RSP- See Also:
-
DONE
protected static final byte DONE- See Also:
-
PAYLOAD
public static final int PAYLOAD- See Also:
-
senders
-
req_latency
-
rsp_latency
-
TRANSPORTS
-
-
Constructor Details
-
RoundTrip
public RoundTrip(boolean use_ms)
-
-
Method Details
-
start
- Throws:
Exception
-
receive
On the server: receive a request, send a response. On the client: send a request, wait for the response- Specified by:
receivein interfaceRtReceiver- Parameters:
sender- The address of the senderreq_buf- The bufferoffset- The offset of the data in the bufferlength- The length (bytes) of the data
-
loop
protected void loop() -
sendRequests
- Throws:
Exception
-
print
-
time
protected static long time(boolean use_ms) -
unit
-
main
- Throws:
Exception
-
help
-
create
- Throws:
Exception
-
availableTransports
-
printOptions
-