如何在jmeter中获取ThreadGroup的当前循环数 [英] How to get current loop number of ThreadGroup in jmeter

查看:893
本文介绍了如何在jmeter中获取ThreadGroup的当前循环数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jmeter.我将ThreadGroup中的Loop Count设置为5,将Thread的数量设置为1.如何获取当前的循环数,以便可以在beanshell后处理器中执行某些操作.

I am using jmeter. I set Loop Count to 5 in ThreadGroup and number of Thread to 1. How can i get the current loop number so i can perform some operation in beanshell postprocessor.

请帮助.预先感谢.

推荐答案

您可以像${__BeanShell(vars.getIteration();,)}那样执行操作:

You can do it like ${__BeanShell(vars.getIteration();,)} where:

  • __Beanshell - JMeter function allowing execution of arbitrary Beanshell script
  • vars - shorthand to JMeterVariables class which holds current JMeter variables
  • getIteration() method returns what you're looking for

请参见如何使用BeanShell:JMeter最喜欢的内置组件指南,了解有关JMeter中Beanshell脚本的更多信息.

See How to use BeanShell: JMeter's favorite built-in component guide for more information on Beanshell scripting in JMeter.

这篇关于如何在jmeter中获取ThreadGroup的当前循环数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆