Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/performance/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance JMeter在测试片段期间将变量写入日志一次_Performance_Jmeter_Load Testing - Fatal编程技术网

Performance JMeter在测试片段期间将变量写入日志一次

Performance JMeter在测试片段期间将变量写入日志一次,performance,jmeter,load-testing,Performance,Jmeter,Load Testing,正在对我们的网站进行负载测试 我有几个测试片段,包括在我的主测试计划中。 在主测试计划中,我将参数设置为线程应该多长时间(在不同的测试片段中暂停),然后再继续 我想向控制台写入我们正在等待的内容,但问题是,在测试片段中,我找不到登录控制台的方法 这是我目前在片段中的内容: 比恩希尔后处理器 log.info("### User is interacting with the GLASSES-page for: " + vars.get("glassesSpentTime") + "ms") 在

正在对我们的网站进行负载测试

我有几个测试片段,包括在我的主测试计划中。 在主测试计划中,我将参数设置为线程应该多长时间(在不同的测试片段中暂停),然后再继续

我想向控制台写入我们正在等待的内容,但问题是,在测试片段中,我找不到登录控制台的方法

这是我目前在片段中的内容:

比恩希尔后处理器

log.info("### User is interacting with the GLASSES-page for: " + vars.get("glassesSpentTime") + "ms")
在控制台中,我会看到每个HTTP请求的日志消息:

jmeter.util.BeanShellTestElement: ### User is interacting with the GLASSES-page for: 37000ms 
jmeter.util.BeanShellTestElement: ### User is interacting with the GLASSES-page for: 37000ms 
jmeter.util.BeanShellTestElement: ### User is interacting with the GLASSES-page for: 37000ms 
等等

我只想在日志中记录此消息一次。 我可以使用什么在测试片段中发送一条日志消息

谢谢


/J

后处理器应该是需要后处理的HTTP请求的子元素。如果与HTTP请求处于同一级别,JMeter会假定所有HTTP请求都需要后处理&调用它

您可能知道,每个线程将分别执行整个线程组。因此,如果有3个用户,那么您将记录3条消息。为了避免这种混淆,您可能需要添加

log.info("### User${__threadNum} - is interacting with the GLASSES-page for: " + vars.get("glassesSpentTime") + "ms")
您将获得如图所示的日志

jmeter.util.BeanShellTestElement: ### User1 - is interacting with the GLASSES-page for: 37000ms  
jmeter.util.BeanShellTestElement: ### User2 - is interacting with the GLASSES-page for: 37000ms  
jmeter.util.BeanShellTestElement: ### User3 - is interacting with the GLASSES-page for: 37000ms

后处理器应该是需要后处理的HTTP请求的子元素。如果与HTTP请求处于同一级别,JMeter会假定所有HTTP请求都需要后处理&调用它

您可能知道,每个线程将分别执行整个线程组。因此,如果有3个用户,那么您将记录3条消息。为了避免这种混淆,您可能需要添加

log.info("### User${__threadNum} - is interacting with the GLASSES-page for: " + vars.get("glassesSpentTime") + "ms")
您将获得如图所示的日志

jmeter.util.BeanShellTestElement: ### User1 - is interacting with the GLASSES-page for: 37000ms  
jmeter.util.BeanShellTestElement: ### User2 - is interacting with the GLASSES-page for: 37000ms  
jmeter.util.BeanShellTestElement: ### User3 - is interacting with the GLASSES-page for: 37000ms

令人惊叹的!我是一名JMeter noob,非常感谢您的意见。如果你的答案行得通,我会试试看,然后记下你的答案。太棒了!我是一名JMeter noob,非常感谢您的意见。如果你的答案行得通,我就试试看,然后标出你的答案。