I've to execute a test where one transaction can have multiple-lines (Eg: orders placed by different users in the real world where every user can have different cart size). In order to achieve this I have a products list and I need unique product at every occurrence. I have used a code similar to this "https://www.perfmatrix.com/jmeter-parameter-setting-unique-each-occurrence/" and I was able to achieve unique each occurrence. But the problem is when I am using a throughput controller and constant throughput timer I am not able to achieve desired TPS whereas hardcoded payload with various lines (with throughput controller and constant throughput timer) leads to desired TPS. Do we have any other options to achieve this?
1条答案
按热度按时间3zwtqj6y1#
Beanshell采样器可能是问题的根本原因,根据JMeter文档,您应该使用JSR223测试元素和Groovy语言进行脚本编写,因为使用Beanshell是某种形式的性能反模式,请查看Apache Groovy: What Is Groovy Used For?文章以了解更多详细信息。
另一个可能的原因可能是测试数据本身,例如,请求A是“轻”的,并且由于其请求参数而在不到一秒的时间内返回数据,而请求“B”是“重”的,并且在超过5秒的时间内返回数据。
100个请求A和100个请求B的吞吐量将不同,因此您可能需要添加更多线程。