我想知道在JMeter中tearDown Thread Group的实际用法。
在哪种情况下我可以使用tearDown Thread Group?
最佳答案
根据 JMeter Tear Down Threadgroup 提供的帮助,
A special type of ThreadGroup that can be utilized to perform Post-Test Actions. The behavior of these threads is exactly like a normal Thread Group element. The difference is that these type of threads execute after the test has finished executing its regular Thread Groups.
简而言之,该线程组用于执行在执行测试后完成/必要的操作。即后测试操作。该线程组将在正常线程组执行完毕后执行。
该线程组可用于测试执行后需要执行某些操作的场景。简单的例子可能是,向服务器发送重置请求,向服务器发送一些预热请求或一些配置更改或客户端执行。
前任。执行我的测试之后如果我想删除一个我只为测试而创建的用户。因此我可以在拆卸线程组中发送 deleteuser 的请求。另一个例子可能是,如果在测试之后我想要一些关于响应数据的报告内容,那么您可以在拆卸线程组中添加示例 java 代码(beanshell 处理器)并执行操作。
请记住,操作可以是任何内容,服务器请求或数据库请求或示例 Java 代码等。条件是,它应该在您的测试执行后完成。
关于multithreading - JMeter:tearDown Thread Group 的目的是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27717019/