Package org.jgroups.tests.perf
Class MPerf
java.lang.Object
org.jgroups.tests.perf.MPerf
- All Implemented Interfaces:
Receiver
Dynamic tool to measure multicast performance of JGroups; every member sends N messages and we measure how long it
takes for all receivers to receive them.
All messages received from a member P are checked for ordering and non duplicity.
MPerf is dynamic because it doesn't accept any configuration parameters (besides the channel config file and name); all configuration is done at runtime, and will be broadcast to all cluster members.
- Since:
- 3.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classprotected static classprotected static classprotected static classprotected class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JChannelprotected booleanprotected static final shortprotected Addressprotected final Logprotected booleanprotected booleanprotected intprotected intprotected intprotected booleanprotected Pathprotected MPerf.MessageCounterprotected final ResponseCollector<MPerf.Result> protected longprotected ThreadFactoryprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringcomputeStats(long time, long msgs, int size) protected voidconfigChange(String name) protected voidprotected voidprotected voidhandleConfigChange(MPerf.ConfigChange config_change) protected voidhandleConfigRequest(Address sender) protected voidstatic voidprotected StringprintAverage(long start_time) protected voidprotected Stringprotected static StringprintPerSender(Address[] sender, long[] received, long msg_size, long diff) voidCalled when a message is received.voidreceive(MessageBatch batch) Called when a batch of messages is receivedprotected voidsend(Address target, Object payload, byte header, Message.Flag... flags) protected MPerf.ResultsendMessages(boolean isSender) protected voidsendNoException(Address target, Object payload, byte header, Message.Flag... flags) voidsetOutPath(Path out_file_path) voidprotected voidvoidstop()voidviewAccepted(View view) Called when a change in membership has occurred.
-
Field Details
-
channel
-
local_addr
-
time
protected int time -
msg_size
protected int msg_size -
num_threads
protected int num_threads -
num_senders
protected int num_senders -
oob
protected boolean oob -
log_local
protected boolean log_local -
display_msg_src
protected boolean display_msg_src -
received_msgs_map
-
members
-
log
-
out_file_path
-
looping
protected boolean looping -
sleep
protected long sleep -
results
-
thread_factory
-
ID
protected static final short ID
-
-
Constructor Details
-
MPerf
- Throws:
IOException
-
MPerf
- Throws:
IOException
-
-
Method Details
-
start
- Throws:
Exception
-
setOutPath
-
eventLoop
protected void eventLoop() -
startTest
- Throws:
Exception
-
displayResults
protected void displayResults() -
printParameters
-
printOutput
-
configChange
- Throws:
Exception
-
sendNoException
-
send
protected void send(Address target, Object payload, byte header, Message.Flag... flags) throws Exception - Throws:
Exception
-
stop
public void stop() -
receive
Description copied from interface:ReceiverCalled when a message is received. -
receive
Description copied from interface:ReceiverCalled when a batch of messages is received -
getSenders
-
handleConfigChange
-
handleConfigRequest
- Throws:
Exception
-
handleConfigResponse
-
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
-
printAverage
-
computeStats
-
printPerSender
-
main
- Throws:
IOException
-