Package org.jgroups.tests.perf
Class ProgrammaticUPerf2
- java.lang.Object
-
- org.jgroups.tests.perf.ProgrammaticUPerf2
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classProgrammaticUPerf2.Invoker
-
Field Summary
Fields Modifier and Type Field Description protected static booleanallow_local_getsprivate static shortALLOW_LOCAL_GETSprotected static intanycast_countprivate static java.lang.StringBIND_ADDRprivate byte[]BUFFERprivate static JChannelchannelprivate java.util.concurrent.atomic.AtomicIntegerCOUNTERprivate static RpcDispatcherdispprotected java.lang.Threadevent_loop_threadprotected static java.lang.Stringformatprivate static shortGETprivate static shortGET_CONFIGprivate static java.lang.Stringgroupnameprotected static NonReflectiveProbeHandlerhprivate static Addresslocal_addrprotected booleanloopingprivate static java.lang.StringMCAST_ADDRprotected static java.util.List<Address>membersprotected static intmsg_sizeprotected java.util.concurrent.atomic.LongAddernum_readsprotected static intnum_threadsprotected java.util.concurrent.atomic.LongAddernum_writesprotected static booleanoobprotected static booleanprint_detailsprivate static shortPRINT_DETAILSprotected static booleanprint_invokersprivate static shortPRINT_INVOKERSprivate static shortPUTprivate static shortQUIT_ALLprotected static doubleread_percentageprivate static shortSET_ANYCAST_COUNTprivate static shortSET_MSG_SIZEprivate static shortSET_NUM_THREADSprivate static shortSET_OOBprivate static shortSET_READ_PERCENTAGEprivate static shortSET_SYNCprivate static shortSET_TIMEprivate static shortSTARTprotected static booleansyncprotected static inttimeprotected static Viewview
-
Constructor Summary
Constructors Constructor Description ProgrammaticUPerf2()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanallowLocalGets()static voidallowLocalGets(boolean a)protected static voidapplyConfig(PerfUtil.Config config)voideventLoop()byte[]get(int key)static intgetAnycastCount()static PerfUtil.ConfiggetConfig()static intgetMsgSize()static intgetNumThreads()static booleangetOOB()static doublegetReadPercentage()static booleangetSync()static intgetTime()(package private) static voidhelp()voidinit(java.lang.String name, java.lang.String bind_addr, int bind_port)protected static voidinvoke(short method_id, java.lang.Object... args)static java.lang.Objectinvoke(java.lang.Object target, short method_id, java.lang.Object[] args)static voidmain(java.lang.String[] args)protected static intparseAnycastCount()(package private) static doubleparseReadPercentage()protected static java.lang.Stringprint(AverageMinMax avg, boolean details)protected java.lang.StringprintAverage(long start_time)static booleanprintDetails()static voidprintDetails(boolean p)static booleanprintInvokers()static voidprintInvokers(boolean p)protected static voidprintView()voidput(int key, byte[] val)voidquitAll()static voidsetAnycastCount(int t)static voidsetMsgSize(int t)static voidsetNumThreads(int t)static voidsetOOB(boolean o)static voidsetReadPercentage(double r)static voidsetSync(boolean s)static voidsetTime(int t)protected voidstartBenchmark()Kicks off the benchmark on all cluster nodesprotected voidstartEventThread()PerfUtil.ResultsstartTest()(package private) static voidstop()protected voidstopEventThread()voidviewAccepted(View v)Called when a change in membership has occurred.
-
-
-
Field Detail
-
groupname
private static final java.lang.String groupname
- See Also:
- Constant Field Values
-
channel
private static final JChannel channel
-
disp
private static final RpcDispatcher disp
-
BIND_ADDR
private static final java.lang.String BIND_ADDR
- See Also:
- Constant Field Values
-
MCAST_ADDR
private static final java.lang.String MCAST_ADDR
- See Also:
- Constant Field Values
-
local_addr
private static Address local_addr
-
members
protected static final java.util.List<Address> members
-
view
protected static volatile View view
-
h
protected static NonReflectiveProbeHandler h
-
looping
protected volatile boolean looping
-
event_loop_thread
protected java.lang.Thread event_loop_thread
-
num_reads
protected final java.util.concurrent.atomic.LongAdder num_reads
-
num_writes
protected final java.util.concurrent.atomic.LongAdder num_writes
-
sync
protected static boolean sync
-
oob
protected static boolean oob
-
num_threads
protected static int num_threads
-
time
protected static int time
-
msg_size
protected static int msg_size
-
anycast_count
protected static int anycast_count
-
read_percentage
protected static double read_percentage
-
allow_local_gets
protected static boolean allow_local_gets
-
print_invokers
protected static boolean print_invokers
-
print_details
protected static boolean print_details
-
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_SYNC
private static final short SET_SYNC
- See Also:
- Constant Field Values
-
SET_OOB
private static final short SET_OOB
- See Also:
- Constant Field Values
-
SET_NUM_THREADS
private static final short SET_NUM_THREADS
- See Also:
- Constant Field Values
-
SET_TIME
private static final short SET_TIME
- See Also:
- Constant Field Values
-
SET_MSG_SIZE
private static final short SET_MSG_SIZE
- See Also:
- Constant Field Values
-
SET_ANYCAST_COUNT
private static final short SET_ANYCAST_COUNT
- See Also:
- Constant Field Values
-
SET_READ_PERCENTAGE
private static final short SET_READ_PERCENTAGE
- See Also:
- Constant Field Values
-
ALLOW_LOCAL_GETS
private static final short ALLOW_LOCAL_GETS
- See Also:
- Constant Field Values
-
PRINT_INVOKERS
private static final short PRINT_INVOKERS
- See Also:
- Constant Field Values
-
PRINT_DETAILS
private static final short PRINT_DETAILS
- See Also:
- Constant Field Values
-
QUIT_ALL
private static final short QUIT_ALL
- See Also:
- Constant Field Values
-
COUNTER
private final java.util.concurrent.atomic.AtomicInteger COUNTER
-
BUFFER
private byte[] BUFFER
-
format
protected static final java.lang.String format
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSync
public static boolean getSync()
-
setSync
public static void setSync(boolean s)
-
getOOB
public static boolean getOOB()
-
setOOB
public static void setOOB(boolean o)
-
getNumThreads
public static int getNumThreads()
-
setNumThreads
public static void setNumThreads(int t)
-
getTime
public static int getTime()
-
setTime
public static void setTime(int t)
-
getMsgSize
public static int getMsgSize()
-
setMsgSize
public static void setMsgSize(int t)
-
getAnycastCount
public static int getAnycastCount()
-
setAnycastCount
public static void setAnycastCount(int t)
-
getReadPercentage
public static double getReadPercentage()
-
setReadPercentage
public static void setReadPercentage(double r)
-
allowLocalGets
public static boolean allowLocalGets()
-
allowLocalGets
public static void allowLocalGets(boolean a)
-
printInvokers
public static boolean printInvokers()
-
printInvokers
public static void printInvokers(boolean p)
-
printDetails
public static boolean printDetails()
-
printDetails
public static void printDetails(boolean p)
-
init
public void init(java.lang.String name, java.lang.String bind_addr, int bind_port) throws java.lang.Exception- Throws:
java.lang.Exception
-
stop
static void stop()
-
startEventThread
protected void startEventThread()
-
stopEventThread
protected void stopEventThread()
-
viewAccepted
public void viewAccepted(View v)
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
-
invoke
public static java.lang.Object invoke(java.lang.Object target, short method_id, java.lang.Object[] args) throws java.lang.Exception- Throws:
java.lang.Exception
-
startTest
public PerfUtil.Results startTest() throws java.lang.Exception
- Throws:
java.lang.Exception
-
quitAll
public void quitAll()
-
printAverage
protected java.lang.String printAverage(long start_time)
-
get
public byte[] get(int key)
-
put
public void put(int key, byte[] val)
-
getConfig
public static PerfUtil.Config getConfig()
-
applyConfig
protected static void applyConfig(PerfUtil.Config config)
-
eventLoop
public void eventLoop()
-
invoke
protected static void invoke(short method_id, java.lang.Object... args) throws java.lang.Exception- Throws:
java.lang.Exception
-
startBenchmark
protected void startBenchmark()
Kicks off the benchmark on all cluster nodes
-
parseReadPercentage
static double parseReadPercentage() throws java.lang.Exception- Throws:
java.lang.Exception
-
parseAnycastCount
protected static int parseAnycastCount() throws java.lang.Exception- Throws:
java.lang.Exception
-
printView
protected static void printView()
-
print
protected static java.lang.String print(AverageMinMax avg, boolean details)
-
main
public static void main(java.lang.String[] args)
-
help
static void help()
-
-