本文整理汇总了Java中org.apache.jmeter.protocol.java.sampler.JavaSamplerContext.getLongParameter方法的典型用法代码示例。如果您正苦于以下问题:Java JavaSamplerContext.getLongParameter方法的具体用法?Java JavaSamplerContext.getLongParameter怎么用?Java JavaSamplerContext.getLongParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jmeter.protocol.java.sampler.JavaSamplerContext
的用法示例。
在下文中一共展示了JavaSamplerContext.getLongParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLeakySpankContext
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext; //导入方法依赖的package包/类
private LeakySpankContext getLeakySpankContext(JavaSamplerContext arg0) {
LeakySpankContext leakySpankContext = threadLocal.get();
if (leakySpankContext==null) {
long pid = arg0.getLongParameter(P_PID);
int intervalInSeconds = arg0.getIntParameter(P_INTERVAL_IN_SECONDS, 15);
int intervalCountPerWindow = arg0.getIntParameter(P_INTERVAL_COUNT_PER_WINDOW, 4);
int topNSuspectsPerWindow = arg0.getIntParameter(P_TOP_N_SUSPECTS_PER_WINDOW, 2);
leakySpankContext = new LeakySpankContext(
pid,
intervalInSeconds,
intervalCountPerWindow,
topNSuspectsPerWindow);
threadLocal.set(leakySpankContext);
}
return leakySpankContext;
}
示例2: setupValues
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext; //导入方法依赖的package包/类
private void setupValues(JavaSamplerContext context) {
sleepTime = context.getLongParameter(SLEEP_NAME, DEFAULT_SLEEP_TIME);
sleepMask = context.getLongParameter(MASK_NAME, DEFAULT_SLEEP_MASK);
responseMessage = context.getParameter(RESPONSE_MESSAGE_NAME, RESPONSE_MESSAGE_DEFAULT);
responseCode = context.getParameter(RESPONSE_CODE_NAME, RESPONSE_CODE_DEFAULT);
success = context.getParameter(SUCCESS_NAME, SUCCESS_DEFAULT).equalsIgnoreCase("OK");
label = context.getParameter(LABEL_NAME, "");
if (label.length() == 0) {
label = context.getParameter(TestElement.NAME); // default to name of element
}
samplerData = context.getParameter(SAMPLER_DATA_NAME, SAMPLER_DATA_DEFAULT);
resultData = context.getParameter(RESULT_DATA_NAME, RESULT_DATA_DEFAULT);
}
示例3: setupTest
import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext; //导入方法依赖的package包/类
/**
* Do any initialization required by this client. In this case,
* initialization consists of getting the values of the SleepTime and
* SleepMask parameters. It is generally recommended to do any
* initialization such as getting parameter values in the setupTest method
* rather than the runTest method in order to add as little overhead as
* possible to the test.
*
* @param context
* the context to run with. This provides access to
* initialization parameters.
*/
@Override
public void setupTest(JavaSamplerContext context) {
if (log.isDebugEnabled()) {
log.debug(whoAmI() + "\tsetupTest()");
listParameters(context);
}
sleepTime = context.getLongParameter("SleepTime", DEFAULT_SLEEP_TIME);
sleepMask = context.getLongParameter("SleepMask", DEFAULT_SLEEP_MASK);
name = context.getParameter(TestElement.NAME);
}