Class MPerf

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

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

    • channel

      protected JChannel channel
    • local_addr

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

      protected MPerf.MessageCounter received_msgs_map
    • members

      protected final List<Address> members
    • log

      protected final Log log
    • out_file_path

      protected Path out_file_path
    • looping

      protected boolean looping
    • sleep

      protected long sleep
    • results

      protected final ResponseCollector<MPerf.Result> results
    • thread_factory

      protected ThreadFactory thread_factory
    • ID

      protected static final short ID
  • Constructor Details

  • Method Details

    • start

      public void start(String props, String name, boolean use_virtual_threads) throws Exception
      Throws:
      Exception
    • setOutPath

      public void setOutPath(Path out_file_path)
    • eventLoop

      protected void eventLoop()
    • startTest

      protected void startTest() throws Exception
      Throws:
      Exception
    • displayResults

      protected void displayResults()
    • printParameters

      protected String printParameters()
    • printOutput

      protected void printOutput(String s)
    • configChange

      protected void configChange(String name) throws Exception
      Throws:
      Exception
    • sendNoException

      protected void sendNoException(Address target, Object payload, byte header, Message.Flag... flags)
    • send

      protected void send(Address target, Object payload, byte header, Message.Flag... flags) throws Exception
      Throws:
      Exception
    • stop

      public void stop()
    • receive

      public void receive(Message msg)
      Description copied from interface: Receiver
      Called when a message is received.
      Specified by:
      receive in interface Receiver
      Parameters:
      msg - The message
    • receive

      public void receive(MessageBatch batch)
      Description copied from interface: Receiver
      Called when a batch of messages is received
      Specified by:
      receive in interface Receiver
      Parameters:
      batch - The message batch
    • getSenders

      protected List<Address> getSenders()
    • handleConfigChange

      protected void handleConfigChange(MPerf.ConfigChange config_change)
    • handleConfigRequest

      protected void handleConfigRequest(Address sender) throws Exception
      Throws:
      Exception
    • handleConfigResponse

      protected void handleConfigResponse(MPerf.Configuration cfg)
    • 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 MPerf.Result sendMessages(boolean isSender)
    • printAverage

      protected String printAverage(long start_time)
    • computeStats

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

      protected static String printPerSender(Address[] sender, long[] received, long msg_size, long diff)
    • main

      public static void main(String[] args) throws IOException
      Throws:
      IOException