Class MPerfRpc

java.lang.Object
org.jgroups.tests.perf.MPerfRpc
All Implemented Interfaces:
Receiver

public class MPerfRpc extends Object implements 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
  • Field Details

    • props

      protected String props
    • channel

      protected JChannel channel
    • disp

      protected RpcDispatcher disp
    • local_addr

      protected Address local_addr
    • name

      protected String 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

      protected final ConcurrentMap<Address,MPerfRpc.Stats> received_msgs
      Maintains stats per sender, will be sent to perf originator when all messages have been received
    • total_received_msgs

      protected final AtomicLong total_received_msgs
    • members

      protected final List<Address> members
    • log

      protected final Log log
    • looping

      protected boolean looping
    • last_interval

      protected long last_interval
    • results

      protected final ResponseCollector<MPerfRpc.Result> results
    • result_collector

      protected volatile Address result_collector
    • initiator

      protected volatile boolean initiator
    • send_options

      protected RequestOptions send_options
    • format

      protected static final NumberFormat 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

      protected static final Method[] METHODS
  • Constructor Details

    • MPerfRpc

      public MPerfRpc()
  • Method Details

    • start

      public void start(String props, String name) throws Exception
      Throws:
      Exception
    • loop

      protected void loop()
    • displayResults

      protected void displayResults()
    • configChange

      protected void configChange(String name) throws Exception
      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

      public void handleData(Address src, byte[] payload, long seqno, boolean check_order)
    • startSending

      public void startSending(Address initiator)
    • sendingDone

      public void sendingDone(Address sender)
    • result

      public void result(Address sender, MPerfRpc.Result res)
      Called when a result from a node is received
    • clearResults

      public void clearResults()
    • configChange

      public void configChange(MPerfRpc.ConfigChange config_change)
    • configReq

      public void configReq(Address sender) throws Exception
      Throws:
      Exception
    • configRsp

      public void configRsp(MPerfRpc.Configuration cfg)
    • exit

      public void exit()
    • getSenders

      protected List<Address> getSenders()
    • viewAccepted

      public void viewAccepted(View view)
      Description copied from interface: Receiver
      Called 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:
      viewAccepted in interface Receiver
    • sendMessages

      protected void sendMessages()
    • computeStats

      protected static String computeStats(long time, long msgs, int size)
    • main

      public static void main(String[] args)