By setting stages, you can model workloads over time, changing
the number of users performing certain tasks to reflect real-world
usage. You can vary the user load and collect performance metrics
for each stage independently, enabling a single run to more efficiently
accomplish what used to require multiple runs by eliminating the repetitive
and unnecessary shutdown and restarting of users. Each stage, which
lasts a specific amount of time and contains a specific number of
users, defines a different load.
About this task
When a schedule contains stages, place the tests in the schedule
in an infinite loop, as shown in the following figure. This prevents
virtual users from finishing the stage before the allotted time.
Procedure
To add stages to a schedule:
- In the Test Navigator, browse to the schedule and double-click
it. The schedule opens. By default, the User Load
page contains one stage with 5 users. The 5 users run until finished.
- On the User Load page, click Add. The Create User Stage window opens. Enter
the information for a schedule stage, and click OK.
Option |
Description |
Number of users |
Enter the total number of users in the stage. This is not
the number of users to add to or to remove from those currently running;
it is the total number of active users at this stage. |
Stage Duration |
Enter the length of time (and the time units) for the stage
to run. Once Number of users is achieved, the
users will run for up to this time. When the time expires, the users
continue to run if they are needed for the next stage, or, if not,
they are stopped gracefully. |
Rate of Change |
When changing the number of users, the amount of time to delay
between adding or removing each user. Adding or removing all users
over a time period changes the users in a uniform random distribution
over the time specified for changing users, which is the time before
the settle and the stage begin. This slight variance closely emulates
human behavior.
Adding or removing one user every time unit
adds the same delay for each user. Although this option does not emulate
human behavior as closely as the first option, it is useful when you
must adhere to a certain rate because of limitations of the system
under test, such as the time it takes for a user to log on to the
system.
|
Settle Time |
Once the desired user population has been reached, a system
might still experience a period of flux in reaction to the change
in user population. Setting a settle time allows the system to re-establish
its steady-state equilibrium so that it can accurately reflect the
user population. The Stage Duration starts
after the settle time expires. The settle time is not counted as part
of the stage duration proper, nor are the settle-time metrics included
in the Compare report, which is generated at the end of the run. However,
settle time does affect how long a schedule runs, because it adds
time to the beginning of each stage. And, although the Compare report
does not include the settle-time metrics, these metrics are collected
and you can include them by changing the time range of the report.
If
your system does not have significant flux or if the stage is long
enough that the flux comprises only a minor part of it, you might
not need a settle time.
|
- On the User Load page, modify the stages as necessary:
- Click Up or Down to
change the order of the rows.
- Double-click a row to modify it.
- Select the Time limit for a user to respond
to a stop request value. If a stage contains
fewer virtual users than its predecessor, the excess users are asked
to stop. This value gives a stopped virtual user extra time to complete
its current action (such as an HTTP request). If the virtual user
cannot complete its action before the time limit expires, it is forced
to stop. Note that a long time limit might delay the next stage.
- Select whether you want the last stage to run until all
work completes. You typically leave this box cleared and
put the users in an infinite loop to let the stage run until the tasks
are finished.
Last stage set to run until all work completes? |
Tests in infinite loop? |
Results |
no |
yes |
Typical case: The run ends when the last stage
ends. |
yes |
no |
The most common reason for selecting this combination
is that a schedule has one stage and you want to run all work to completion
(equivalent to a schedule without stages). Setting these options for
a multi-stage schedule runs the risk that the schedule will run out
of work and stop before completion. |
yes |
yes |
Not advisable: Schedule runs until you stop
it. |
no |
no |
Not a typical case: Useful for running a single-stage
schedule and stopping the run at a specific time, whether or not virtual
users have completed the workload. |
- Examine the User Load Preview to
verify that the stages are set correctly. The red line segments indicate
that the total number of users has been achieved for the stage and
the settle time, if any, has ended. The following
figure illustrates a schedule with two 16-minute stages. The second
stage has a 4-minute change rate and a 4-minute settle time:
What to do next
You can display a Compare report, which compares the time
ranges of each stage, when the run is complete. This report provides
a quick side-by-side analysis of how the system under test performs
under various user loads. To display a Compare report, right-click
the test results and select
Compare All Time Ranges.
To
display a Compare report automatically at the end of each staged schedule
run, click , and select Launch Compare report when staged
run completes.