public class RoundTrip extends Object implements RtReceiver
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.Modifier and Type | Class and Description |
---|---|
protected class |
RoundTrip.Sender |
Modifier and Type | Field and Description |
---|---|
protected boolean |
details |
protected static byte |
DONE |
protected int |
num_msgs |
protected int |
num_senders |
static int |
PAYLOAD |
protected static byte |
REQ |
protected AverageMinMax |
req_latency |
protected static byte |
RSP |
protected AverageMinMax |
rsp_latency |
protected RoundTrip.Sender[] |
senders |
protected RtTransport |
tp |
protected static Map<String,String> |
TRANSPORTS |
protected boolean |
use_ms |
Constructor and Description |
---|
RoundTrip(boolean use_ms) |
Modifier and Type | Method and Description |
---|---|
protected static String |
availableTransports() |
protected static RtTransport |
create(String transport) |
protected static void |
help(String transport) |
protected void |
loop() |
static void |
main(String[] args) |
protected String |
print(AverageMinMax avg) |
protected static String |
printOptions(String[] opts) |
void |
receive(Object sender,
byte[] req_buf,
int offset,
int length)
On the server: receive a request, send a response.
|
protected void |
sendRequests() |
protected void |
start(String transport,
String[] args) |
protected static long |
time(boolean use_ms) |
protected String |
unit() |
protected RtTransport tp
protected int num_msgs
protected int num_senders
protected boolean details
protected boolean use_ms
protected static final byte REQ
protected static final byte RSP
protected static final byte DONE
public static final int PAYLOAD
protected RoundTrip.Sender[] senders
protected final AverageMinMax req_latency
protected final AverageMinMax rsp_latency
public void receive(Object sender, byte[] req_buf, int offset, int length)
receive
in interface RtReceiver
sender
- The address of the senderreq_buf
- The bufferoffset
- The offset of the data in the bufferlength
- The length (bytes) of the dataprotected void loop()
protected String print(AverageMinMax avg)
protected static long time(boolean use_ms)
protected String unit()
protected static void help(String transport)
protected static RtTransport create(String transport) throws Exception
Exception
protected static String availableTransports()
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.