Class UPerf

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

public class UPerf extends Object implements Receiver
Tests the UNICAST by invoking unicast RPCs between a sender and a receiver. Mimicks the DIST mode in Infinispan
  • Field Details

    • channel

      private JChannel channel
    • local_addr

      private Address local_addr
    • disp

      private RpcDispatcher disp
    • groupname

      static final String groupname
      See Also:
    • members

      protected final List<Address> members
    • view

      protected volatile View view
    • looping

      protected volatile boolean looping
    • num_reads

      protected final LongAdder num_reads
    • num_writes

      protected final LongAdder num_writes
    • thread_factory

      protected ThreadFactory thread_factory
    • results_coll

      protected final ResponseCollector<PerfUtil.Results> results_coll
    • oob

      protected boolean oob
    • num_threads

      protected int num_threads
    • time

      protected int time
    • msg_size

      protected int msg_size
    • anycast_count

      protected int anycast_count
    • read_percentage

      protected double read_percentage
    • rpc_timeout

      protected long rpc_timeout
    • METHODS

      private static final Method[] METHODS
    • START_TEST

      private static final short START_TEST
      See Also:
    • GET

      private static final short GET
      See Also:
    • PUT

      private static final short PUT
      See Also:
    • GET_CONFIG

      private static final short GET_CONFIG
      See Also:
    • SET

      private static final short SET
      See Also:
    • QUIT_ALL

      private static final short QUIT_ALL
      See Also:
    • ACCEPT_RESULTS

      private static final short ACCEPT_RESULTS
      See Also:
    • OOB

      protected static final Field OOB
    • NUM_THREADS

      protected static final Field NUM_THREADS
    • TIME

      protected static final Field TIME
    • RPC_TIMEOUT

      protected static final Field RPC_TIMEOUT
    • MSG_SIZE

      protected static final Field MSG_SIZE
    • ANYCAST_COUNT

      protected static final Field ANYCAST_COUNT
    • READ_PERCENTAGE

      protected static final Field READ_PERCENTAGE
    • BUFFER

      private byte[] BUFFER
    • format

      protected static final String format
      See Also:
  • Constructor Details

    • UPerf

      public UPerf()
  • Method Details

    • time

      public UPerf time(int t)
    • size

      public UPerf size(int s)
    • threads

      public UPerf threads(int t)
    • init

      public void init(String props, String name, AddressGenerator generator, int bind_port, boolean use_virtual_threads, boolean async_rsp_handling) throws Throwable
      Throws:
      Throwable
    • stop

      void stop()
    • stopEventLoop

      protected void stopEventLoop()
    • viewAccepted

      public void viewAccepted(View new_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
    • startTest

      public void startTest(Address sender) throws Throwable
      Throws:
      Throwable
    • acceptResults

      public void acceptResults(Address sender, PerfUtil.Results results)
      Called by worker when done; response to startTest()
    • quitAll

      public void quitAll()
    • printAverage

      protected String printAverage(long start_time)
    • set

      public void set(String field_name, Object value)
    • get

      public byte[] get(long key)
    • put

      public void put(long key, byte[] val)
    • getConfig

      public PerfUtil.Config getConfig()
    • startTest

      protected PerfUtil.Results startTest() throws Throwable
      Throws:
      Throwable
    • sendResults

      protected void sendResults(Address dest, PerfUtil.Results results)
    • applyConfig

      protected void applyConfig(PerfUtil.Config config)
    • eventLoop

      public void eventLoop()
    • startBenchmark

      protected void startBenchmark()
      Kicks off the benchmark on all cluster nodes
    • getReadPercentage

      static double getReadPercentage() throws Exception
      Throws:
      Exception
    • getAnycastCount

      int getAnycastCount() throws Exception
      Throws:
      Exception
    • changeFieldAcrossCluster

      protected void changeFieldAcrossCluster(Field field, Object value) throws Exception
      Throws:
      Exception
    • printView

      protected void printView()
    • print

      protected static String print(AverageMinMax avg, boolean details)
    • getSites

      protected static List<String> getSites(JChannel channel)
    • getReceiver

      private Address getReceiver()
      Picks the next member in the view
    • main

      public static void main(String[] args) throws IOException, ClassNotFoundException
      Throws:
      IOException
      ClassNotFoundException
    • help

      static void help()