|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.webmbt.plugin.PluginAncestor
com.webmbt.plugin.ConcurrentPlugin
com.webmbt.plugin.LoadPlugin
public class LoadPlugin
Copyright TestOptimal, LLC Load plugin contains the mScript method implementation to submit, control and monitor model execution on remote TestOptimal servers. This is used for load testing and stress testing with many models executing concurrently. It requires SvrMgr which provides Runtime servers for submitting model for execution.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.webmbt.plugin.MScriptInterface |
|---|
MScriptInterface.MSCRIPT_METHOD |
| Field Summary | |
|---|---|
static java.lang.String |
VAR_BATCH_DESC
|
static java.lang.String |
VAR_BATCH_GROUP
|
static java.lang.String |
VAR_BATCH_ID
|
static java.lang.String |
VAR_NEXT_CAT_CODE
|
static java.lang.String |
VAR_SESSION_ID
|
| Constructor Summary | |
|---|---|
LoadPlugin()
|
|
| Method Summary | |
|---|---|
void |
activateState(java.lang.String stateID_p)
activates a specific state in the current model resulting in all transitions originating from the specified state to be dispatched for immediate execution. |
void |
activateState(java.lang.String stateID_p,
java.lang.String modelName_p)
activates a specific state in the model currently executing in the same server, resulting in all transitions originating from the specified state to be dispatched for immediate execution. |
void |
close()
INTERNAL USE ONLY. |
void |
connectSvrMgr()
Connects to SvrMgr to run models on Runtime servers managed by SvrMgr. |
void |
disconnectSvrMgr()
Disconnects from SvrMgr to direct model execution to this server. |
boolean |
execTriggerAfter(com.webmbt.ScriptDesc scriptObj_p)
|
boolean |
execTriggerBefore(com.webmbt.ScriptDesc scriptObj_p)
INTERNAL USE ONLY. |
java.lang.String |
getPluginID()
Returns the plugin ID: Load. |
boolean |
isError(java.lang.Exception e_p)
INTERNAL USE ONLY. |
void |
limitToCatCodes(java.lang.String catCodes_p)
limit model execution from this point in time to only hosts that have been assigned any of the category codes passed in. |
void |
limitToHosts(java.lang.String hosts_p)
restrict from this point in time any model execution to only the hosts specified. |
void |
resetBatch()
interrupts all existing models. |
void |
rmtActivateState(java.lang.String stateID_p,
java.lang.String modelName_p,
java.lang.String svrCatCodes_p)
activates a specific state in a model running on a remote host, resulting in transition(s) originating from the specified state to be dispatched for immediate execution according to the activation type defined for the state. |
java.lang.String |
rmtGetVar(java.lang.String varName_p,
java.lang.String modelName_p,
java.lang.String svrCatCodes_p)
gets the user variable from a model execution running on a remote host. |
void |
rmtSetVar(java.lang.String varName_p,
java.lang.String varVal_p,
java.lang.String modelName_p,
java.lang.String svrCatCodes_p)
sets the user variable in a model execution running on a remote host. |
void |
rmtTriggerTrans(java.lang.String stateID_p,
java.lang.String transID_p,
java.lang.String modelName_p,
java.lang.String svrCatCodes_p)
triggers a specific transition in another model running in a remote host, causing the immediate execution of the transition. |
java.lang.String |
runModel(java.lang.String modelName_p,
java.lang.String sequencer_p,
java.lang.String catCode_p,
java.lang.String threadCount_p)
dispatches model execution using the specified sequencer and thread count on a runtime server available with the default stop condition specified with the model. |
java.lang.String |
runModel(java.lang.String modelName_p,
java.lang.String sequencer_p,
java.lang.String catCodes_p,
java.lang.String threadCount_p,
java.lang.String options_p)
dispatches model execution using the specified sequencer and thread count on a runtime server available with the additional options and stop conditions. |
void |
setBatchDesc(java.lang.String batchDesc_p)
sets the description for this execution batch. |
void |
setCheckIntervalMillis(java.lang.String millis_p)
sets the number of milliseconds between retries to find available server to execute the model or for completion of model executions. |
void |
setRetryTimeoutMillis(java.lang.String millis_p)
sets the number of milliseconds to timeout the retrying for available Runtime server for execution of a model. |
static void |
shutdown()
INTERNAL USE ONLY. |
java.lang.String |
snapScreen(java.lang.String fileName_p)
INTERNAL USE ONLY. |
void |
start()
INTERNAL USE ONLY. |
void |
startBatchGroup(java.lang.String batchGroup_p)
set up a new batch group within the current batch with the group code passed in. |
void |
triggerTrans(java.lang.String stateID_p,
java.lang.String transID_p)
triggers a specific transition in the current model causing the immediate execution of the transition. |
void |
triggerTrans(java.lang.String stateID_p,
java.lang.String transID_p,
java.lang.String modelName_p)
triggers a specific transition in another model running in the same server, causing the immediate execution of the transition. |
java.lang.String |
waitForCompletion(java.lang.String timeoutMinutes_p)
wait for all model execution sessions in the current batch to finish. |
java.lang.String |
waitForCompletion(java.lang.String batchGroup_p,
java.lang.String timeoutMinutes_p)
wait for model executions in the batch group passed in to finish execution. |
java.lang.String |
waitForCompletion(java.lang.String sessionID_p,
java.lang.String timeoutMinutes_p,
java.lang.String stopOnTimeout_p)
waits for a model execution session to complete. |
java.lang.String |
waitForPageToLoad()
do not use. |
| Methods inherited from class com.webmbt.plugin.ConcurrentPlugin |
|---|
setAsyncTransThreadPoolSize, setMaxAsyncTrans |
| Methods inherited from class com.webmbt.plugin.PluginAncestor |
|---|
addException, getCurScript, getData, getData, getDataMgr, getDataSetRowNum, getInitParams, getMethodList, getMScriptAPI, getMScriptMethodList, getNativeMethod, getNativePluginObj, getPathVar, getScriptExecutor, getVar, initialize, isReady, next, registerVarChangeListener, replaceEscapeChar, rewind, setData, setInitParams, setPathVar, setReady, setVar, snapScreen, uiLocatorMap |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VAR_BATCH_ID
public static final java.lang.String VAR_BATCH_DESC
public static final java.lang.String VAR_SESSION_ID
public static final java.lang.String VAR_BATCH_GROUP
public static final java.lang.String VAR_NEXT_CAT_CODE
| Constructor Detail |
|---|
public LoadPlugin()
| Method Detail |
|---|
public static void shutdown()
public void close()
PluginAncestor
close in class ConcurrentPlugin
public void start()
throws java.lang.Exception
start in class ConcurrentPluginjava.lang.Exception
public java.lang.String snapScreen(java.lang.String fileName_p)
throws java.lang.Exception
PluginAncestor
snapScreen in class ConcurrentPluginjava.lang.Exceptionpublic java.lang.String getPluginID()
getPluginID in class ConcurrentPluginpublic boolean isError(java.lang.Exception e_p)
PluginAncestor
isError in class ConcurrentPlugin
public java.lang.String waitForPageToLoad()
throws java.lang.Exception
waitForPageToLoad in class ConcurrentPluginjava.lang.Exception
public boolean execTriggerBefore(com.webmbt.ScriptDesc scriptObj_p)
throws java.lang.Exception
execTriggerBefore in interface TriggerInterfaceexecTriggerBefore in class ConcurrentPluginjava.lang.Exception
public boolean execTriggerAfter(com.webmbt.ScriptDesc scriptObj_p)
throws java.lang.Exception
execTriggerAfter in interface TriggerInterfaceexecTriggerAfter in class ConcurrentPluginjava.lang.Exception
public java.lang.String runModel(java.lang.String modelName_p,
java.lang.String sequencer_p,
java.lang.String catCode_p,
java.lang.String threadCount_p)
throws java.lang.Exception
waitForCompletion(String, String, String).
Example: $runModel('demoModel','optimalSequencer','myCat1,myCat2','5')
modelName_p - - name of the modelsequencer_p - - sequencer to be used to execute the model
catCode_p - - category to choose which Runtime server to execute model. Blank to choose
any Runtime server or specify a category code to run model on the Runtime server which has
the category code. Multiple category codes may be specified separated by a comma. When
multiple category codes are specified, Runtime server must contain all of the category
codes specified.threadCount_p - - number of virtual users(threads) to be used to execute the model
java.lang.Exception
public java.lang.String runModel(java.lang.String modelName_p,
java.lang.String sequencer_p,
java.lang.String catCodes_p,
java.lang.String threadCount_p,
java.lang.String options_p)
throws java.lang.Exception
waitForCompletion(String, String, String).
Multiple stop conditions and options are seperated by semi-colon. The available options are:
& = ; &
custom.
Example: $runModel('demoModel','optimalSequencer','cat2','5','stopMinutes=5;browser=iexplore_8')
The MBT execution session ID is stored in path variable _sessionID
modelName_p - - name of the modelsequencer_p - - see runModel(String, String, String, String)catCodes_p - - see runModel(String, String, String, String)threadCount_p - - see runModel(String, String, String, String)options_p - additional options for model executions including stop conditions. See description above.
java.lang.Exception#runModel(String, String, String, String)},
#waitForCompletion(String, String, String)}
public void resetBatch()
throws java.lang.Exception
Example: $resetBatch()
java.lang.Exception
public void setBatchDesc(java.lang.String batchDesc_p)
throws java.lang.Exception
The MBT execution batch ID is stored in user variable _batchID
Only one batch can be started during model execution. Subsequent call to this function will just change the batch description.
Example: $setBatchDesc('my batch 1')
batchDesc_p -
java.lang.Exceptionpublic void setCheckIntervalMillis(java.lang.String millis_p)
millis_p - public void setRetryTimeoutMillis(java.lang.String millis_p)
millis_p -
public java.lang.String waitForCompletion(java.lang.String timeoutMinutes_p)
throws java.lang.Exception
Example: $waitForCompletion('30') - waits for all model executions to complete up to 30 minutes, if there is any model execution not completed after 30 minutes, it returns "TimedOut". Otherwise it returns "OK".
maxRuntimeMinutes_p - timeout in minutes.
java.lang.Exception - on timeout
public java.lang.String waitForCompletion(java.lang.String batchGroup_p,
java.lang.String timeoutMinutes_p)
throws java.lang.Exception
Example: $waitForCompletion('IE_Group', '30') - waits for all model executions to complete up to 30 minutes, if there is any model execution not completed after 30 minutes, it returns "TimedOut". Otherwise it returns "OK".
maxRuntimeMinutes_p - timeout in minutes.
java.lang.Exception - on timeout
public java.lang.String waitForCompletion(java.lang.String sessionID_p,
java.lang.String timeoutMinutes_p,
java.lang.String stopOnTimeout_p)
throws java.lang.Exception
Example: $waitForCompletion('$runModel('demoModel','optimalSequencer','myCat1,myCat2','5')', '30', 'true')
In the above example, it runs the model "demoModel". The sessionID returned form the runModel() is passed in to $waitForCompletion() function. The timeout is set to 30 minutes and the model execution is to be interrupted if it does not complete before the 30 minutes timeout setting.
sessionID_p - - sessionID returned from $runModel()timeoutMinutes_p - timeout in minutes. if 0, negative or invalid timeout setting is specified, the timeout minutes
will be set to 5 minutes.
TimedOut if timeout triggered, or OK for other conditions
java.lang.Exception
public void limitToHosts(java.lang.String hosts_p)
throws java.lang.Exception
Example: $limitToHosts('host1,host2')
hosts_p - colon (or semi-colon) separated list of host names
java.lang.Exception
public void limitToCatCodes(java.lang.String catCodes_p)
throws java.lang.Exception
catCodes_p -
java.lang.Exception
public void connectSvrMgr()
throws java.lang.Exception
java.lang.ExceptiondisconnectSvrMgr()
public void disconnectSvrMgr()
throws java.lang.Exception
java.lang.ExceptionconnectSvrMgr()
public void rmtSetVar(java.lang.String varName_p,
java.lang.String varVal_p,
java.lang.String modelName_p,
java.lang.String svrCatCodes_p)
throws com.webmbt.MBTException
In the above example, it sets the variable var1 to value val2 on the modelX running on a remote host which has the category code of IE. Category code is used to differentiate Runtime servers or group certain Runtime servers together. In this case, our Runtime servers that are running IE browsers are assigned IE while Runtime servers running Firefox browsers are assigned FF, etc. In our example above the same model may be executing simultaneously in multiple servers and we are only interested in setting the variable on the first model execution found running IE browser.
varName_p - varVal_p - modelName_p - svrCatCodes_p -
com.webmbt.MBTException#setVar()
public java.lang.String rmtGetVar(java.lang.String varName_p,
java.lang.String modelName_p,
java.lang.String svrCatCodes_p)
throws com.webmbt.MBTException
In the above example, it gets the variable var1 from the modelX running on a remote host which has the category code of IE. Category code is used to differentiate or group Runtime servers. In this case, our Runtime servers that are running IE browsers are assigned IE while Runtime servers running Firefox browsers are assigned FF, etc. In our example above the same model may be executing simultanenously in multiple servers and we are only interested in getting the variable on the model execution running IE browsers.
varName_p - varVal_p - modelName_p - svrCatCodes_p -
com.webmbt.MBTException#getVar()
public void rmtActivateState(java.lang.String stateID_p,
java.lang.String modelName_p,
java.lang.String svrCatCodes_p)
throws com.webmbt.MBTException
stateID_p - modelName_p - svrCatCodes_p -
com.webmbt.MBTException
public void rmtTriggerTrans(java.lang.String stateID_p,
java.lang.String transID_p,
java.lang.String modelName_p,
java.lang.String svrCatCodes_p)
throws com.webmbt.MBTException
stateID_p - transID_p - modelName_p - svrCatCodes_p - to find server that has any of the cat codes specified
com.webmbt.MBTException
public void activateState(java.lang.String stateID_p)
throws java.lang.Exception
activateState in class ConcurrentPluginjava.lang.Exception
public void activateState(java.lang.String stateID_p,
java.lang.String modelName_p)
throws com.webmbt.MBTException
activateState in class ConcurrentPluginstateID_p - modelName_p -
com.webmbt.MBTException
public void triggerTrans(java.lang.String stateID_p,
java.lang.String transID_p)
throws java.lang.Exception
triggerTrans in class ConcurrentPluginstateID_p - transID_p -
java.lang.Exception
public void triggerTrans(java.lang.String stateID_p,
java.lang.String transID_p,
java.lang.String modelName_p)
throws com.webmbt.MBTException
triggerTrans in class ConcurrentPluginstateID_p - transID_p - modelName_p -
com.webmbt.MBTException
public void startBatchGroup(java.lang.String batchGroup_p)
throws java.lang.Exception
batchGroup_p -
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||