运行时自定义JMeter属性的限制值 [英] Limit values of custom JMeter Properties at runtime

查看:136
本文介绍了运行时自定义JMeter属性的限制值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个分布式JMeter设置,如下所述-

We've a distributed JMeter setup as described here - How to Change JMeter´s Load During Runtime

测试计划(JMX文件)由用户提供.因此,我们不知道其中使用的属性名称.在运行时,用户可以提供属性名称和值,我们将通过beanshell脚本直接将这些名称和值传递给JMeter设置.

The test plan (JMX file) is provided by the user. Hence, we don't know the property names used in there. During runtime, the user can provide property names and values that we will directly pass to JMeter setup through beanshell script.

在此设置中,我们可以对用户可以在运行时更改的某些JMeter属性(可能会影响我们提供的资源)的值设置限制/上限吗?

In this setup, can we put a limit/cap on values of certain JMeter properties (which can potentially affect our provided resources) that can be changed by the user at runtime?

例如我们不希望系统的总RPS随时超过300 RPS.或者,如果用户提供了#threads的运行时更改功能,则我们不希望它们在任何时间在任何计算机上都超过100.

For eg. we don't want the total RPS of the system to cross say, 300 RPS at anytime. Or if the user has provided runtime change capability of #threads, we don't want them to exceed say, 100 on any machine at anytime.

我们希望避免在系统中存储任何用户定义的属性名称以提供这种验证.

We want to refrain from storing any user-defined property names in our system to provide such validation.

推荐答案

您可以注入恒定吞吐量计时器精确吞吐量计时器或<将href ="https://www.blazemeter.com/blog/using-jmeters-throughput-shaping-timer-plugin/" rel ="nofollow noreferrer">吞吐量整形计时器放入用户提供的.jmx脚本,然后在其中放置您允许的最大并发量.

You can inject a Constant Throughput Timer or a Precise Throughput Timer or a Throughput Shaping Timer into the user-provided .jmx script and put your maximum allowed concurrency there.

即使测试计划中有多个计时器,JMeter也会应用最慢​​的吞吐量,因此,如果原始RPS低于最大计时器,您就不会进行太快的测试反之亦然,无论使用什么RPS用户,它都不会超过您定义的300 RPS.

Even if there will be multiple timers in the test plan JMeter will apply the throughput of the slowest one so you won't make the test too fast in case if original RPS is lower than your maximum and vice versa, no matter what RPS user will want it will never get higher than 300 RPS which you will define.

相同的方法适用于线程组中的线程数.

The same approach applies to the number of threads in thread group.

这篇关于运行时自定义JMeter属性的限制值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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