当前位置: 首页>>代码示例>>Java>>正文


Java JavaSamplerContext.getLongParameter方法代码示例

本文整理汇总了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;
}
 
开发者ID:eostermueller,项目名称:heapSpank,代码行数:19,代码来源:LeakySpankSampler.java

示例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);
    }
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:21,代码来源:JavaTest.java

示例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);
}
 
开发者ID:johrstrom,项目名称:cloud-meter,代码行数:23,代码来源:SleepTest.java


注:本文中的org.apache.jmeter.protocol.java.sampler.JavaSamplerContext.getLongParameter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。