Package org.jgroups.util
Class RTT
- java.lang.Object
-
- org.jgroups.util.RTT
-
public class RTT extends java.lang.Object
Measures round-trip times (RTT) between nodes- Since:
- 5.4, 5.3.8
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
enabled
protected int
num_reqs
protected boolean
oob
protected java.util.Map<Address,AverageMinMax>
rtts
protected int
size
protected long
timeout
protected java.util.Map<Address,long[]>
times
protected short
tp_id
protected TP
transport
-
Constructor Summary
Constructors Constructor Description RTT()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<Address,AverageMinMax>
_rtt(int num_reqs, int size, boolean exclude_self)
boolean
enabled()
RTT
enabled(boolean f)
void
handleMessage(Message msg, TpHeader hdr)
Called when a message (request or response) is receivedprotected void
handleRequest(Address sender, TpHeader hdr)
protected void
handleResponse(Address sender, int index)
void
init(TP tp)
int
numReqs()
RTT
numReqs(int n)
boolean
oob()
RTT
oob(boolean b)
protected static java.lang.String
percentiles(AverageMinMax avg, int num_reqs)
protected static java.lang.String
print(AverageMinMax avg, boolean details, java.util.concurrent.TimeUnit unit, int num_reqs)
java.lang.String
rtt()
java.lang.String
rtt(int num_reqs, boolean details)
Sends N requests to all members and computes RTTsjava.lang.String
rtt(int num_reqs, int size, boolean details, boolean exclude_self)
Sends N requests to all members and computes RTTsint
size()
RTT
size(int size)
long
timeout()
RTT
timeout(long t)
-
-
-
Field Detail
-
transport
protected TP transport
-
tp_id
protected short tp_id
-
enabled
protected boolean enabled
-
num_reqs
protected int num_reqs
-
timeout
protected long timeout
-
size
protected int size
-
oob
protected boolean oob
-
rtts
protected final java.util.Map<Address,AverageMinMax> rtts
-
times
protected final java.util.Map<Address,long[]> times
-
-
Method Detail
-
enabled
public boolean enabled()
-
enabled
public RTT enabled(boolean f)
-
numReqs
public int numReqs()
-
numReqs
public RTT numReqs(int n)
-
timeout
public long timeout()
-
timeout
public RTT timeout(long t)
-
size
public int size()
-
size
public RTT size(int size)
-
oob
public boolean oob()
-
oob
public RTT oob(boolean b)
-
init
public void init(TP tp)
-
rtt
public java.lang.String rtt()
-
rtt
public java.lang.String rtt(int num_reqs, boolean details)
Sends N requests to all members and computes RTTs- Parameters:
num_reqs
- The number of requests to be sent to all membersdetails
- Whether to print details (e.g. min/max/percentiles)
-
rtt
public java.lang.String rtt(int num_reqs, int size, boolean details, boolean exclude_self)
Sends N requests to all members and computes RTTs- Parameters:
num_reqs
- The number of requests to be sent to all memberssize
- The number of bytes a request should havedetails
- Whether to print details (e.g. min/max/percentiles)exclude_self
- Whether to exclude the local node
-
_rtt
public java.util.Map<Address,AverageMinMax> _rtt(int num_reqs, int size, boolean exclude_self)
-
handleMessage
public void handleMessage(Message msg, TpHeader hdr)
Called when a message (request or response) is received
-
handleResponse
protected void handleResponse(Address sender, int index)
-
print
protected static java.lang.String print(AverageMinMax avg, boolean details, java.util.concurrent.TimeUnit unit, int num_reqs)
-
percentiles
protected static java.lang.String percentiles(AverageMinMax avg, int num_reqs)
-
-