JMeter and simulating the real users

2019-08-12 19:32发布

问题:

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:

  1. Ultimate Thread Group - to control virtual users arrival rate and time to hold the load
  2. 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
  3. 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.