Package org.jgroups.tests.perf
Class UPerf
- java.lang.Object
-
- org.jgroups.tests.perf.UPerf
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classUPerf.Invoker
-
Field Summary
Fields Modifier and Type Field Description protected intanycast_countprotected static java.lang.reflect.FieldANYCAST_COUNTprivate byte[]BUFFERprivate JChannelchannelprivate RpcDispatcherdispprotected static java.lang.Stringformatprivate static shortGETprivate static shortGET_CONFIG(package private) static java.lang.Stringgroupnameprivate Addresslocal_addrprotected booleanloopingprotected java.util.List<Address>membersprivate static java.lang.reflect.Method[]METHODSprotected intmsg_sizeprotected static java.lang.reflect.FieldMSG_SIZEprotected java.util.concurrent.atomic.LongAddernum_readsprotected intnum_threadsprotected static java.lang.reflect.FieldNUM_THREADSprotected java.util.concurrent.atomic.LongAddernum_writesprotected booleanoobprotected static java.lang.reflect.FieldOOBprotected booleanprint_detailsprotected static java.lang.reflect.FieldPRINT_DETAILSprotected booleanprint_invokersprotected static java.lang.reflect.FieldPRINT_INVOKERSprivate static shortPUTprivate static shortQUIT_ALLprotected doubleread_percentageprotected static java.lang.reflect.FieldREAD_PERCENTAGEprotected longrpc_timeoutprotected static java.lang.reflect.FieldRPC_TIMEOUTprivate static shortSETprivate static shortSTARTprotected ThreadFactorythread_factoryprotected inttimeprotected static java.lang.reflect.FieldTIMEprotected Viewview
-
Constructor Summary
Constructors Constructor Description UPerf()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyConfig(PerfUtil.Config config)protected voidchangeFieldAcrossCluster(java.lang.reflect.Field field, java.lang.Object value)voideventLoop()byte[]get(long key)(package private) intgetAnycastCount()PerfUtil.ConfiggetConfig()(package private) static doublegetReadPercentage()private AddressgetReceiver()Picks the next member in the viewprotected static java.util.List<java.lang.String>getSites(JChannel channel)(package private) static voidhelp()voidinit(java.lang.String props, java.lang.String name, AddressGenerator generator, int bind_port, boolean use_fibers)static voidmain(java.lang.String[] args)protected static java.lang.Stringprint(AverageMinMax avg, boolean details)protected java.lang.StringprintAverage(long start_time)protected voidprintView()voidput(long key, byte[] val)voidquitAll()voidset(java.lang.String field_name, java.lang.Object value)(package private) voidstartBenchmark()Kicks off the benchmark on all cluster nodesPerfUtil.ResultsstartTest()(package private) voidstop()protected voidstopEventLoop()voidviewAccepted(View new_view)Called when a change in membership has occurred.
-
-
-
Field Detail
-
channel
private JChannel channel
-
local_addr
private Address local_addr
-
disp
private RpcDispatcher disp
-
groupname
static final java.lang.String groupname
- See Also:
- Constant Field Values
-
members
protected final java.util.List<Address> members
-
view
protected volatile View view
-
looping
protected volatile boolean looping
-
num_reads
protected final java.util.concurrent.atomic.LongAdder num_reads
-
num_writes
protected final java.util.concurrent.atomic.LongAdder num_writes
-
thread_factory
protected ThreadFactory thread_factory
-
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
-
print_invokers
protected boolean print_invokers
-
print_details
protected boolean print_details
-
rpc_timeout
protected long rpc_timeout
-
METHODS
private static final java.lang.reflect.Method[] METHODS
-
START
private static final short START
- See Also:
- Constant Field Values
-
GET
private static final short GET
- See Also:
- Constant Field Values
-
PUT
private static final short PUT
- See Also:
- Constant Field Values
-
GET_CONFIG
private static final short GET_CONFIG
- See Also:
- Constant Field Values
-
SET
private static final short SET
- See Also:
- Constant Field Values
-
QUIT_ALL
private static final short QUIT_ALL
- See Also:
- Constant Field Values
-
OOB
protected static final java.lang.reflect.Field OOB
-
NUM_THREADS
protected static final java.lang.reflect.Field NUM_THREADS
-
TIME
protected static final java.lang.reflect.Field TIME
-
RPC_TIMEOUT
protected static final java.lang.reflect.Field RPC_TIMEOUT
-
MSG_SIZE
protected static final java.lang.reflect.Field MSG_SIZE
-
ANYCAST_COUNT
protected static final java.lang.reflect.Field ANYCAST_COUNT
-
READ_PERCENTAGE
protected static final java.lang.reflect.Field READ_PERCENTAGE
-
PRINT_INVOKERS
protected static final java.lang.reflect.Field PRINT_INVOKERS
-
PRINT_DETAILS
protected static final java.lang.reflect.Field PRINT_DETAILS
-
BUFFER
private byte[] BUFFER
-
format
protected static final java.lang.String format
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(java.lang.String props, java.lang.String name, AddressGenerator generator, int bind_port, boolean use_fibers) throws java.lang.Throwable- Throws:
java.lang.Throwable
-
stop
void stop()
-
stopEventLoop
protected void stopEventLoop()
-
viewAccepted
public void viewAccepted(View new_view)
Description copied from interface:ReceiverCalled 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 whenJChannel.connect(String)returns.- Specified by:
viewAcceptedin interfaceReceiver
-
startTest
public PerfUtil.Results startTest() throws java.lang.Throwable
- Throws:
java.lang.Throwable
-
quitAll
public void quitAll()
-
printAverage
protected java.lang.String printAverage(long start_time)
-
set
public void set(java.lang.String field_name, java.lang.Object value)
-
get
public byte[] get(long key)
-
put
public void put(long key, byte[] val)
-
getConfig
public PerfUtil.Config getConfig()
-
applyConfig
protected void applyConfig(PerfUtil.Config config)
-
eventLoop
public void eventLoop()
-
startBenchmark
void startBenchmark()
Kicks off the benchmark on all cluster nodes
-
getReadPercentage
static double getReadPercentage() throws java.lang.Exception- Throws:
java.lang.Exception
-
getAnycastCount
int getAnycastCount() throws java.lang.Exception- Throws:
java.lang.Exception
-
changeFieldAcrossCluster
protected void changeFieldAcrossCluster(java.lang.reflect.Field field, java.lang.Object value) throws java.lang.Exception- Throws:
java.lang.Exception
-
printView
protected void printView()
-
print
protected static java.lang.String print(AverageMinMax avg, boolean details)
-
getSites
protected static java.util.List<java.lang.String> getSites(JChannel channel)
-
getReceiver
private Address getReceiver()
Picks the next member in the view
-
main
public static void main(java.lang.String[] args) throws java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
help
static void help()
-
-