Package org.jgroups.tests.perf
Class MPerfRpc
java.lang.Object
org.jgroups.tests.perf.MPerfRpc
- All Implemented Interfaces:
Receiver
Dynamic tool to measure multicast RPC performance of JGroups; every member invokes N RPCs and we measure how long it
takes for all receivers to receive them.
Initially copied from MPerf.
- Since:
- 3.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classprotected static classprotected classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JChannelprotected static final shortprotected static final shortprotected static final shortprotected static final shortprotected RpcDispatcherprotected static final shortprotected static final NumberFormatprotected static final shortprotected booleanprotected longprotected Addressprotected final Logprotected intprotected booleanprotected static final Method[]protected intprotected Stringprotected intprotected intprotected intprotected booleanprotected Stringprotected intprotected final ConcurrentMap<Address, MPerfRpc.Stats> Maintains stats per sender, will be sent to perf originator when all messages have been receivedprotected static final shortprotected Addressprotected final ResponseCollector<MPerfRpc.Result> protected RequestOptionsprotected static final shortprotected static final shortprotected booleanprotected final AtomicLong -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected static StringcomputeStats(long time, long msgs, int size) protected voidconfigChange(String name) voidconfigChange(MPerfRpc.ConfigChange config_change) voidvoidprotected voidvoidexit()voidhandleData(Address src, byte[] payload, long seqno, boolean check_order) protected ObjectinvokeRpc(short method_id, Address dest, RequestOptions options, Object... args) protected RspList<?> invokeRpc(short method_id, RequestOptions options, Object... args) protected voidloop()static voidvoidresult(Address sender, MPerfRpc.Result res) Called when a result from a node is receivedvoidsendingDone(Address sender) protected voidvoidvoidstartSending(Address initiator) voidstop()voidviewAccepted(View view) Called when a change in membership has occurred.
-
Field Details
-
props
-
channel
-
disp
-
local_addr
-
name
-
num_msgs
protected int num_msgs -
msg_size
protected int msg_size -
num_threads
protected int num_threads -
log_interval
protected int log_interval -
receive_log_interval
protected int receive_log_interval -
num_senders
protected int num_senders -
sync
protected boolean sync -
oob
protected boolean oob -
received_msgs
Maintains stats per sender, will be sent to perf originator when all messages have been received -
total_received_msgs
-
members
-
log
-
looping
protected boolean looping -
last_interval
protected long last_interval -
results
-
result_collector
-
initiator
protected volatile boolean initiator -
send_options
-
format
-
handleData
protected static final short handleData- See Also:
-
startSending
protected static final short startSending- See Also:
-
sendingDone
protected static final short sendingDone- See Also:
-
result
protected static final short result- See Also:
-
clearResults
protected static final short clearResults- See Also:
-
configChange
protected static final short configChange- See Also:
-
configReq
protected static final short configReq- See Also:
-
configRsp
protected static final short configRsp- See Also:
-
exit
protected static final short exit- See Also:
-
METHODS
-
-
Constructor Details
-
MPerfRpc
public MPerfRpc()
-
-
Method Details
-
start
- Throws:
Exception
-
loop
protected void loop() -
displayResults
protected void displayResults() -
configChange
- Throws:
Exception
-
invokeRpc
protected RspList<?> invokeRpc(short method_id, RequestOptions options, Object... args) throws Exception - Throws:
Exception
-
invokeRpc
protected Object invokeRpc(short method_id, Address dest, RequestOptions options, Object... args) throws Exception - Throws:
Exception
-
stop
public void stop() -
handleData
-
startSending
-
sendingDone
-
result
Called when a result from a node is received -
clearResults
public void clearResults() -
configChange
-
configReq
- Throws:
Exception
-
configRsp
-
exit
public void exit() -
getSenders
-
viewAccepted
Description copied from interface:ReceiverCalled when a change in membership has occurred. No long running actions, sending of messages or anything that could block should be done in this callback. If some long running action needs to be performed, it should be done in a separate thread.Note that on reception of the first view (a new member just joined), the channel will not yet be in the connected state. This only happens when
JChannel.connect(String)returns.- Specified by:
viewAcceptedin interfaceReceiver
-
sendMessages
protected void sendMessages() -
computeStats
-
main
-