JMeter和模拟真实用户 [英] JMeter and simulating the real users
问题描述
我想知道是否可以使用JMeter创建一个可以基于某种模式从用户列表"中选择用户的模拟器.实际上,甚至更简单:假设我有0到N个用户.其中有些用户处于活动状态,有些则没有.我想让某些模拟用户在一定时间段内(例如一小时)处于活动状态,然后进入休眠状态,其他用户变为活动状态等.因此,在总共N个用户中,我每小时会有X个唯一活动用户,Y每天唯一身份活跃用户,每周Z个唯一身份活跃用户,等等.
I am wondering if there is something I could use to create a simulator using JMeter that would pick the users from my "user list" based on some kind of pattern. In fact, even simpler: imagine I have the users from 0 to N. Some of them are active, some of them are not. I would like to have some simulated users that are active during certain period (say, hour), then they go dormant, others become active etc. So, out of total N users I would have something like X unique active users per hour, Y unique active users per day, Z unique active users per week etc.
我想我可以编写这样的生成器,但我想知道是否已经存在-作为JMeter插件或只是我可以使用的库/类.
I think I could write some kind of generator like this but I am wondering if something already exists - as JMeter plugin or just a library/class that I could use.
推荐答案
请参阅以下测试元素,这些元素可以帮助您实现所请求的方案:
See the following test elements which can help you to implement scenario requested:
- 最终线程组-控制虚拟用户的到达速率和保持负载的时间
- 恒定吞吐量计时器-用于控制虚拟用户的活动可以通过简单的算术计算将每分钟的请求数"转换为每秒的请求数"或每天的请求数"
- 通过以下方式提供虚拟用户的唯一性:
- Ultimate Thread Group - to control virtual users arrival rate and time to hold the load
- Constant Throughput Timer - to control virtual users activity in "requests per minute" which can be converted to "requests per second" or "requests per day" by simple arithmetic calculations
- Provide uniqueness of virtual users via:
- CSV Data Set Config configuration element or __CSVRead() function - for pre-defined users list
- __Random or __RandomString function for dynamic unique parameters.
这篇关于JMeter和模拟真实用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!