gpt4 book ai didi

JMeter - 在 Beanshell 监听器中检测 TransactionController 采样器

转载 作者:行者123 更新时间:2023-12-02 05:04:54 28 4
gpt4 key购买 nike

是否有办法在 BeanShell 监听器脚本中确定样本结果/事件是否在事务 Controller 下?

我知道您可以使用 sampleEvent.isTransactionSampleEvent() 来确定事件是否针对 TransactionController。但是,在下面的示例中,是否可以在执行 HTTP 请求 2 的 BeanShell 监听器时检查它是否在事务 Controller 下?

Thread Group
HttpRequest 1
TransactionController
HttpRequest 2
HttpRequest 3
HttpRequest 4

最佳答案

为什么不用后缀 (-underTC) 命名您的采样器并在您的监听器中测试它:

  • JMeterContext#getCurrentSampler()#getName()

尝试使用内部 JMeter API 可能会破坏您将来的测试。

关于JMeter - 在 Beanshell 监听器中检测 TransactionController 采样器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13085877/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com