Package org.jgroups.tests.perf
Class UdpPerf
- java.lang.Object
-
- org.jgroups.tests.perf.UdpPerf
-
public class UdpPerf extends java.lang.ObjectDynamic 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. 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 Classes Modifier and Type Class Description protected classUdpPerf.Receiverprotected classUdpPerf.Sender
-
Field Summary
Fields Modifier and Type Field Description protected longlast_intervalprotected intlog_intervalprotected booleanloopingprotected java.net.MulticastSocketmcast_sockprotected intmsg_sizeprotected intnum_msgsprotected intnum_threadsprotected intreceive_log_intervalprotected UdpPerf.Receiverreceiverprotected java.net.SocketAddresssock_addrprotected java.util.concurrent.atomic.LongAddertotal_received_msgsMaintains stats per sender, will be sent to perf originator when all messages have been received
-
Constructor Summary
Constructors Constructor Description UdpPerf()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidhandleData()protected voidloop()static voidmain(java.lang.String[] args)(package private) voidreset()protected voidsend(byte[] payload)protected voidsendMessages()voidstart()voidstop()
-
-
-
Field Detail
-
mcast_sock
protected java.net.MulticastSocket mcast_sock
-
sock_addr
protected java.net.SocketAddress sock_addr
-
receiver
protected UdpPerf.Receiver receiver
-
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
-
total_received_msgs
protected final java.util.concurrent.atomic.LongAdder total_received_msgs
Maintains stats per sender, will be sent to perf originator when all messages have been received
-
looping
protected boolean looping
-
last_interval
protected long last_interval
-
-
Method Detail
-
start
public void start() throws java.lang.Exception- Throws:
java.lang.Exception
-
loop
protected void loop()
-
send
protected void send(byte[] payload) throws java.lang.Exception- Throws:
java.lang.Exception
-
stop
public void stop()
-
handleData
protected void handleData()
-
reset
void reset()
-
sendMessages
protected void sendMessages()
-
main
public static void main(java.lang.String[] args)
-
-