3. Complex Load Generation
Intro
Let’s not extend the test we’ve been looking at previously, but create a completely new test that shows how easy it is to create more a more complex, but still totally realistic scenario. We’re going to look into the Scheduling Components, which are created to control how tests run connected to time.
Preparations
As before: make sure you are in Local Mode in the System toolbar at the bottom of this window, and then run the LoadTest by pressing the Run button on the top left toolbar
The Limit
This TestCase will run for 10 minutes. When those ten minutes are up the TestCase will stop.
The Setup
Here’s a bit of complexity but the test we’re creating is very sophisticated and very hard to do with commercial software.
The Scheduling
To set up how the test will run, we have three different Schedulers, which is what’s used in loadUI to manage how the test runs over time they are connected to three different Load Generators that loads a Web Page Runner with different strategies.
- The first two minutes
First we set up an Interval Scheduler that runs for two minutes. This scheduler controls a Ramp Generator that starts by sending 0 requests per second and ramps up to 100 requests per second. - The following 8 minutes
For the final 8 minutes of the test we run at the rate of 100 requests per second but use the Random Generator to make the load more unpredictable. The randomness is Gaussian and has a random factor of 50%. Let’s walk through all controls in the component.
- Base Rate is just that, the Load Rate we will base our randomness from. If we didn’t random it at all this is what we would have all the time.
- Unit is how often the Rate should change, in our case every minute.
- Distribution is how the randomness work. Not all randomness is like flipping a coin, or Uniform randomness as we call it. For example in the randomness we use, Gaussian, we are more likely to get a value close to the base rate. Gaussian Distribution is also called normal distribution or a Bell Curve. The random factor works differently depending on which distribution you use, but in our case, the Gaussian distribution, this means the higher the factor, the flatter the curve is and the more likely we are to have a high spread. That is, the test is more random.
- During the 8 minutes
During the last 8 minutes we’ve added an extra spice. We’ve added a Scheduler to the 8 minute Interval which is constantly running. And on every day at every hour every minute at the 00 mark it runs for 10 seconds. A normal use case for The Scheduler is running it at a certain time every day or something similar.
The Scheduler controls a Fixed rate Generator that send 100 Requests per second.
Note
Note a few things:
- How do you know when an Interval is running?
When any component is running the little diode in the top left corners is blinking, but on an Interval you can also see a small meter in the Test Duration Progress bar.
- If you look at the Generators, when a Scheduler starts or stops a Generator it also turns it on or off as you can see on the ON/OFF button. The Generators will also blink.







