问题
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.
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.
回答1:
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.
来源:https://stackoverflow.com/questions/25274647/jmeter-and-simulating-the-real-users