Schedule performance tests
You use the Scheduler to create a schedule that distributes load in a performance test in a controlled manner.
Scheduler Overview
Using the Global Scheduler, you can:
-
Set the time at which the test should begin running, and specify how long the Scheduler should wait after the Run Test command is issued, and before running Vusers.
-
Stipulate:
- How to initialize the Vusers in the test
-
How many Vusers to start/stop within a given time period
-
How often to start running the Vusers—simultaneously or gradually
For details, see Scheduler actions.
-
Limit the run duration of the Vusers or Vuser groups within the test by specifying the amount of time the Vusers or Vuser groups should be in the running state.
-
Set a test to run according to the runtime settings defined for the enabled Vuser groups, or set the Vuser groups to run over and over again until the schedule settings instruct them to stop running.
To define a performance test schedule, see Define a schedule for the test.
Alternatively, you can schedule a test to run in Goal-Oriented run mode. You stipulate the goals you want your test to achieve, and LoadRunner Enterprise automatically builds a schedule for you based on these goals. For details, see Distribute Vusers by goal.
Scheduler actions
A performance test schedule contains a sequence of actions that instruct the test when to start running a Vuser group, how to initialize Vusers, when to start and stop running Vusers, and how long to run an action.
The Start Group action defines when to start running a Vuser group. By default, the Start Group action appears as the first action in the Global Scheduler grid when you select a workload of type: by group.
Options |
Description |
---|---|
Start immediately |
The Scheduler starts running the selected Vuser group as soon as the test starts running. Resulting action: Start immediately after the test begins. |
Start with delay |
After the test starts running, the Scheduler waits the specified time (in hours, minutes, and seconds) before it starts running the selected Vuser group. Resulting action: Start (HH:MM:SS) after the test begins. |
Start when group |
The Scheduler starts running the selected Vuser group immediately after the Vuser group specified in this option has finished running. Resulting action: Start when group <group name> finishes. |
Note:
-
The Start Group action is available for group schedules only.
-
The Start Group action is always followed by the Initialize action.
-
The Start Group action cannot be deleted.
The Initialize action instructs the Scheduler to prepare the Vusers so that they are in the Ready state and can run. By default, the Initialize action appears in the Global Scheduler grid for all types of schedules.
Options |
Description |
---|---|
Initialize all Vusers simultaneously |
The Scheduler initializes all the Vusers in the test or selected Vuser group together, and waits the specified amount of time before running them. Resulting action: |
Initialize gradually |
The Scheduler initializes the specified number of Vusers gradually, according to the specified time interval (in hours, minutes, and seconds), and waits the specified amount of time before running them. Resulting action: |
Initialize each Vuser just before it runs |
The Scheduler initializes each Vuser in the test or selected Vuser group just before it starts running. Resulting action: Initialize each Vuser just before it runs. Note: This option is not available for Group schedules when Wait for all groups to initialize is selected. See Wait for all groups to initialize. |
Note: The Initialize action cannot be deleted.
The Start Vusers action instructs the Scheduler to start running the Vusers.
Options |
Description |
---|---|
Start All Vusers: Simultaneously |
The Scheduler runs all the Vusers in the test simultaneously. |
Start X Vusers: gradually |
The Scheduler runs the specified number of Vusers (X) gradually. That is, the Scheduler runs Y Vusers, and waits the specified time (in hours, minutes, and seconds) before running another Y Vusers. Resulting action: Start X Vusers: Y Vusers every <hh:mm:ss> (HH:MM:SS) |
Note:
-
The Scheduler starts running Vusers only when they have reached the Ready state.
-
In a basic schedule, the Scheduler always runs all the Vusers, whether simultaneously or gradually. In a real-world schedule, you can select how many Vusers to start running at a time.
-
While a test is running, you can add Vuser groups/scripts to the test and enable them. When starting the Vusers gradually, if you add a Vuser group after all the Vusers in the test have started running, the new group will start running immediately.
The Duration action instructs the Scheduler to continue running the test in the current state, for the specified amount of time.
Options |
Description |
---|---|
Run until complete |
The test runs until all the Vusers have finished running. Resulting action: Run until completion |
Run for |
The test runs in its current state for the specified amount of time (in days, hours, minutes, and seconds) before continuing with the next action. Default: 5 minutes Maximum definable duration period: 99.23:59:59 dd.HH:MM:SS. Resulting action: Run for <dd.hh:mm:ss> (dd.HH:MM:SS) |
Run indefinitely |
The test runs indefinitely. Resulting action: Run indefinitely Available for: Basic schedule only |
Note:
-
In a real-world schedule, if a Duration action is not followed by another action, the test continues to run indefinitely.
-
In a real-world schedule, to avoid unexpected behavior during the test run, add a Duration action between consecutive Start Vusers and Stop Vusers actions.
-
In a basic schedule, a Run for Duration action is always followed by a Stop Vuser action.
The Stop Vusers action instructs the Scheduler to stop the running Vusers.
Options |
Description |
---|---|
Stop All Vusers: Simultaneously |
The Scheduler stops all the running Vusers at once. |
Stop All/X Vuser: gradually |
The Scheduler stops the specified number of Vusers (All or X) gradually. That is, the Scheduler stops Y Vusers, and waits the specified time (in hours, minutes, and seconds) before stopping another Y Vusers. Resulting action: Stop <X> Vuser: <Y> Vusers every <hh:mm:ss> (HH:MM:SS) |
Note:
-
A basic schedule that has a Run for Duration action, is always followed by a Stop Vuser action that stops all the Vusers, simultaneously or gradually.
-
In a real-world schedule, to avoid unexpected behavior during the test run, add a Duration action between consecutive Start Vusers and Stop Vusers actions.
-
In a real-world schedule, if no action is specified after a Run for Duration action, the Vusers continue to run indefinitely—that is, the schedule continues to run indefinitely.
-
When scheduling by group, if Group A is scheduled to run indefinitely, and Group B is scheduled to run after Group A, then Group A must be stopped manually before Group B can start running.
Types of Test Schedules
When you design a performance test, you can define a schedule according to which the participating Vuser groups should run in the test.
You can schedule all the groups to run together on one schedule, or you can define a separate schedule for each Vuser group.
When you schedule by test, all the Vuser groups participate in the test run simultaneously. That is, the schedule is applied to all the Vuser groups concurrently, and each action is applied proportionally to all the Vusers groups.
For example, take a test that includes three participating Vuser groups as follows:
Group Name |
Number of Vusers |
---|---|
Group1 |
10 |
Group2 |
20 |
Group3 |
30 |
Total |
60 |
When scheduling by test, if the scheduler instructs 30 Vusers to start running when it starts the test run, a proportional number of Vusers starts running from each group as follows:
Group Name |
Number of Vusers |
---|---|
Group1 |
5 |
Group2 |
10 |
Group3 |
15 |
Total |
30 |
Note: The same principle applies when the test is in percentage mode.
Note: For tests in Vuser group (number) mode only.
When you schedule by Vuser group, each Vuser group participating in the test runs on its own separate schedule. That is, for each Vuser group, you can specify when to start running the Vuser group, how many Vusers in the group to start and stop running within specified time intervals, and how long the group should continue running.
Group schedules can run separately, or all at the same time.
Schedule run modes
You can schedule a test to run according to the runtime settings defined for the Vuser groups, or you can let the groups run over and over again until the test schedule instructs them to stop running.
You can schedule a test to run in one of the following run modes:
-
Real-world run mode. The test runs according to a user-defined group of actions that simulate a real-world schedule of events. Vuser groups run according to the iterations defined in their runtime settings, but you can define how many Vusers to run at a time, how long Vusers should continue to run, and how many Vusers to stop running at a time.
-
Basic run mode. All enabled Vuser groups run together on one schedule, each according to its own runtime settings. You can schedule how many Vusers to start running at a time, and how long they should run before stopping.
-
Goal-oriented run mode. The test runs according to a schedule automatically built by LoadRunner Enterprise, based on the goal you defined for your test to achieve. You can specify the number of Vusers to run simultaneously, or the number of Hits or Transactions Per Second.
The following table illustrates how the given schedule types run in real-world versus basic run mode:
Schedule by | Run Mode - Real World | Run Mode - Basic |
---|---|---|
Test |
All participating Vuser groups run together on one schedule. The test runs according to a user-defined group of actions that emulates a true-to-life schedule of events. You can schedule Vusers to start and stop running numerous times during the test, and specify how long to keep them in their running or stopped state. |
All participating Vuser groups run together on one schedule, each according to its own runtime settings. You schedule when to start running all the Vusers, specify how long they should run, and then specify how to stop running all the Vusers. |
Group (Not applicable when the test is in Percentage mode) |
Each participating Vuser group runs according to its own defined schedule that emulates a true-to-life schedule of events for that Vuser group. You can schedule Vusers in the groups to start and stop running numerous times during the test, and specify how long to keep them in their running or stopped state. |
Each participating Vuser group runs according to its own schedule, each according to its own runtime settings. For each Vuser group, you schedule when to start running the Vuser group, how to start running all the Vusers in the group, specify how long the Vusers should run, and then specify how to stop running all the Vusers in the group. |
Define a schedule for the test
This task describes how to define a schedule for a performance test.
-
-
Open Performance Test Designer > Groups & Workload, under the Groups section, make sure the test contains scripts.
-
The Scheduler must be enabled. Click the Options button located at the top of the Groups & Workload view. In the Test Options dialog box, ensure that Enable Scheduler is selected. For details, see Configure test options.
-
-
Define a set of scheduler actions
-
The Global Schedule grid displays the default scheduler actions that correspond to the basic or real-world workload type selected in the Workload type box for schedules.
In real-world schedules, you can add more scheduler actions, and edit or delete existing actions.
In basic schedules, you can edit the existing scheduler actions.
For details about the scheduler actions, see Scheduler actions.
For details about how to add actions (real-world schedules only), see Schedule performance tests.
-
If you selected Goal-Oriented Schedule in the Workload type box, the Goal definition for grid is displayed. In goal-oriented schedules, you can define a goal for the test and configure the goal settings. For details, see Distribute Vusers by goal.
-
-
Group schedules only: Copy a Vuser group's scheduler settings to other groups - optional
When scheduling by Vuser group, you can copy a Vuser group's scheduler settings to other Vuser groups.
Note:
-
Scheduler settings copied include the scheduler run mode (basic or real-world) and the set of defined scheduler actions.
-
This option is disabled for global schedules.
-
On the Groups grid toolbar, click the Duplicate Scheduler Settings button.
-
Select the source group whose settings you want to copy, and select one or more target groups.
-
Click Apply. The source group's scheduler settings are copied to the target groups.
-
-
Schedule a start time for the test - optional
Click the Options button located at the top of the Groups & Workload view. Select Start the Scheduler after a Delay of, and enter the amount of time after which to start running the test.
Add actions to a test schedule
This task describes how to add actions to a real-world test schedule. You can add actions to the schedule from the Global Scheduler grid. You can also add actions from the graph by splitting an action into two halves of the original action.
Note:
-
You can add actions to a real-world schedule only.
-
A new action is always added after the action selected in the Global scheduler grid.
To add an action to the schedule from the Global Scheduler grid:
-
In the Global scheduler grid, select an action after which to insert the new action, and click the New scheduler action button's down arrow.
-
Select the type of action to add.
-
In the Properties column, specify the action's properties.
-
If you are adding a Start Vusers or Stop Vusers action, enter the number of Vusers to start/stop running, and select how to start/stop running the Vusers: simultaneously or gradually.
If you selected gradually, enter the number of Vusers to start/stop at a time, and a time interval.
-
If you are adding a Duration action, select how long to run the action.
-
When you have finished adding actions to the schedule, click Save at the bottom of the Workload tab.
Note: You can add a Start Vusers, Stop Vusers, or Duration action. For details about each type of action, see Scheduler actions.
Note: If you navigate away from the Performance Test Designer window without clicking Save, changes applied to the schedule are not saved.
To add an action by splitting one action into two actions:
-
Select the action in the grid, or the line in the graph that represents the action that you want to split.
-
Click the Split selected action button . The selected action/line splits in two. In the Global scheduler grid, the original action splits into two equivalent actions, each representing half of the original action.
Example:
-
Splitting a Duration action of 5 minutes results in two Duration actions of 2.5 minutes each.
-
Splitting a Start Vusers action that starts 20 Vusers results in two Start Vusers actions, each starting 10 Vusers.
-
-
(Optional) Edit each of the actions.
Tip: Selecting the action in the Global Scheduler grid highlights the corresponding line in the graph.
Edit the scheduler during a test run
You can edit the scheduler during a performance test run.
-
On the Performance Test Run page, click Design Groups and Scheduler. Then select Edit Scheduler.
-
You can edit a defined schedule in the scheduler section.
The Global/Groups Schedule section displays whether the current schedule has been defined by test or by group.
-
Start Time. Enter a delay time for the scheduler to restart after editing. To restart the scheduler immediately, leave this setting blank.
-
Wait. (Groups schedule only) Select to initialize all Vuser groups together.
-
Group. (Groups schedule only) Select individual groups to display and edit their schedules.
For details about each type of action, see Scheduler actions.
-
Note: After restarting the scheduler, the scheduler starts at the beginning of the current step. For example, if you stop the scheduler 2 hours into a duration step of 3 hours, the scheduler will restart the step, and run the step for 5 hours.