Class MPerfRpc

  • All Implemented Interfaces:
    Receiver

    public class MPerfRpc
    extends java.lang.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 Detail

      • props

        protected java.lang.String props
      • local_addr

        protected Address local_addr
      • name

        protected java.lang.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 java.util.concurrent.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 java.util.concurrent.atomic.AtomicLong total_received_msgs
      • members

        protected final java.util.List<Address> members
      • log

        protected final Log log
      • looping

        protected boolean looping
      • last_interval

        protected long last_interval
      • result_collector

        protected volatile Address result_collector
      • initiator

        protected volatile boolean initiator
      • format

        protected static final java.text.NumberFormat format
      • METHODS

        protected static final java.lang.reflect.Method[] METHODS
    • Constructor Detail

      • MPerfRpc

        public MPerfRpc()
    • Method Detail

      • start

        public void start​(java.lang.String props,
                          java.lang.String name)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • loop

        protected void loop()
      • displayResults

        protected void displayResults()
      • configChange

        protected void configChange​(java.lang.String name)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • invokeRpc

        protected RspList<?> invokeRpc​(short method_id,
                                       RequestOptions options,
                                       java.lang.Object... args)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • invokeRpc

        protected java.lang.Object invokeRpc​(short method_id,
                                             Address dest,
                                             RequestOptions options,
                                             java.lang.Object... args)
                                      throws java.lang.Exception
        Throws:
        java.lang.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()
      • configReq

        public void configReq​(Address sender)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • exit

        public void exit()
      • getSenders

        protected java.util.List<Address> getSenders()
        Returns all members if num_senders <= 0, or the members with rank <= num_senders
      • 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 java.lang.String computeStats​(long time,
                                                       long msgs,
                                                       int size)
      • main

        public static void main​(java.lang.String[] args)