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


Java JavaSamplerContext.getIntParameter方法代码示例

本文整理汇总了Java中org.apache.jmeter.protocol.java.sampler.JavaSamplerContext.getIntParameter方法的典型用法代码示例。如果您正苦于以下问题:Java JavaSamplerContext.getIntParameter方法的具体用法?Java JavaSamplerContext.getIntParameter怎么用?Java JavaSamplerContext.getIntParameter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.jmeter.protocol.java.sampler.JavaSamplerContext的用法示例。


在下文中一共展示了JavaSamplerContext.getIntParameter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: setupTest

import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext; //导入方法依赖的package包/类
@Override
public void setupTest(JavaSamplerContext ctx) {
   loopCount = ctx.getIntParameter("loopCount");
   name = ctx.getParameter("name");
   sleepWhenUnsuccesful = ctx.getIntParameter("sleepWhenUnsuccesful");
   testcase = ctx.getParameter("testcase");
   param2 = ctx.getParameter("param2");
   System.out.println("---- setup");
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:10,代码来源:CibetJMeterShedLoad.java

示例3: run

import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext; //导入方法依赖的package包/类
@Override
protected void run(JavaSamplerContext context) throws Exception {
	String uploadFile = context.getParameter(ExampleParameter.SWIFT_UPLOAD_FILE.name());
	int readTimeout = context.getIntParameter(ExampleParameter.SWIFT_READ_TIMEOUT.name());

	String containerName = OpenstackUtil.generateName();
	String objectName = OpenstackUtil.generateName();

	log.debug("creating container " + containerName);
	exceptionIfError(os.objectStorage().containers().create(containerName));

	log.debug("uploading file " + uploadFile);
	os.objectStorage().objects().put(containerName, objectName, Payloads.create(new File(uploadFile)));

	int waited = 0;
	SwiftObject object = null;
	while (waited < readTimeout) {
		object = os.objectStorage().objects().get(containerName, objectName);
		if (object != null)
			break;
		log.debug("waiting for object " + objectName);
		try {
			Thread.sleep(100);
		} catch (InterruptedException e) {
			break;
		}
	}

	log.debug("deleting object " + objectName);
	logIfError(os.objectStorage().objects().delete(containerName, objectName));

	log.debug("deleting container " + containerName);
	logIfError(os.objectStorage().containers().delete(containerName));

	if (object == null)
		throw new OpenstackException("object " + uploadFile + " read failed");
}
 
开发者ID:savoirfairelinux,项目名称:jmeter-openstack,代码行数:38,代码来源:SwiftSampler.java

示例4: run

import org.apache.jmeter.protocol.java.sampler.JavaSamplerContext; //导入方法依赖的package包/类
@Override
protected void run(JavaSamplerContext context) throws Exception {
	String uploadImage = context.getParameter(ExampleParameter.GLANCE_UPLOAD_IMAGE.name());
	int readTimeout = context.getIntParameter(ExampleParameter.GLANCE_READ_TIMEOUT.name());

	String imageName = OpenstackUtil.generateName();

	log.debug("uploading image " + uploadImage);
	Payload<File> payload = Payloads.create(new File(uploadImage));
	Image image = os.images().create(
			Builders.image().name(imageName).isPublic(true).containerFormat(ContainerFormat.BARE)
					.diskFormat(DiskFormat.QCOW2).build(), payload);

	int waited = 0;
	String imageId = image.getId();
	image = null;
	while (waited < readTimeout) {
		image = os.images().get(imageId);
		if (image != null)
			break;
		log.debug("waiting for image " + uploadImage);
		try {
			Thread.sleep(100);
		} catch (InterruptedException e) {
			break;
		}
	}

	log.debug("deleting image " + imageName);
	logIfError(os.images().delete(imageId));

	if (image == null)
		throw new OpenstackException("image " + uploadImage + " read failed");
}
 
开发者ID:savoirfairelinux,项目名称:jmeter-openstack,代码行数:35,代码来源:GlanceSampler.java


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