Sunday 12 May 2013

LoadRunner Tutorial



8
Running The Load Test
When you run the test, LoadRunner creates load on the application. You can
then use LoadRunner’s monitors and graphs to observe the performance of
the application under real-life conditions.
In this lesson you will cover the following topics:
The Controller Run View at a Glance
How do I run a load test scenario?
How do I monitor the application under load?
How do I watch a user running in real time?
Where can I view a summary of user actions?
How can I increase the load during the test?
How is the application coping under load?
Did the application encounter errors?
How do I know that the test has finished running?
Did the application perform well under load?
The Controller Run View at a Glance
The Run tab in the Controller window is the control center from which the
test is managed and monitored. The Run view contains five main sections:
Scenario Groups
Scenario Status
Available Graphs Tree
Graph Viewing Area
Graph Legend

Scenario Groups: In the upper-left pane, you can view the status of Vusers in
the scenario groups. You use the buttons to the right of this pane to start,
stop, and reset the scenario, to view individual Vuser status, and to increase
the load on the application during a scenario by manually adding more
Vusers.
Scenario Status: In the upper-right pane, you can view a summary of the
load test, including the number of running Vusers and the status of each
Vuser action.
Available Graphs Tree: In the middle-left pane, you can see a list of the
LoadRunner graphs. To open a graph, select a graph in the tree, and drag it
into the graph viewing area.
Graph Viewing Area: In the middle-right pane, you can customize the
display to view between one and eight graphs (View > View Graphs).
Graph Legend: In the lower pane, you can view data from the selected
graph.
How do I run a load test scenario?
In this section, you will start the scenario.
1 Open the Controller Run view.
Select the Run tab at the bottom of the screen.
Notice that there are 8 Vusers in the Down column of the Scenario Groups
area. These are the Vusers you created when you created the scenario.

Since the scenario has not yet run, all other counters remain at zero and all
the graphs in the graph viewing area (except Windows Resources) are blank.
When you start the scenario in the next step, the graphs and counters will
begin to display information.
How do I monitor the application under load?
You use the Controller’s online graphs to view performance data collected
by the monitors. You use this information to isolate potential problem areas
in your system environment.
1 Examine the Performance graphs.
The Run tab displays the following default online graphs:
Running Vusers - Whole Scenario graph displays the number of Vusers
running at a given time.
Transaction Response Time - Whole Scenario graph shows the amount of
time it takes for each transaction to be completed.
Hits per Second - Whole Scenario graph displays the number of hits (HTTP
requests) made to the Web server by Vusers during each second of the
scenario run.
Windows Resources graph displays the Windows resources measured during
a scenario.

2 Highlight individual measurements.
Double-click the Windows Resources graph pane to enlarge it. Notice that
each measurement appears on a color-coded row in the graph legend. Each
row corresponds to a line in the graph with the same color.
Selecting a row highlights the corresponding line in the graph, and vice
versa. Double-click the graph again to reduce it.

How do I watch a user running in real time?
When emulating users, you should be able to view their actions in real time
and make sure they are performing the right steps. The Controller lets you
view the actions in real time using the run-time viewer.
To visually observe the Vuser’s actions:
1 Click the Vusersbutton. The Vusers window opens.

The status column displays the status of each Vuser. You can see in the
example above that four Vusers are Running and four are in the Down status.
The Start Vusers action in the scheduler instructed the Controller to release
twoVusers at a time. As the scenario progresses, Vusers will continue to be
added in groups of two at 30-second intervals.
2 Select a running Vuser in the Vuser list.
3 Click the Show the selected Vusersbutton on the Vusers toolbar. The Run-
Time Viewer opens and displays the action currently being performed by the
selectedVuser. The window is updated as the Vuser proceeds through the
steps of the recorded scenario.
4 Click the Hide the selected Vusersbutton on the Vusers toolbar to close the
Run-Time Viewer log.
Where can I view a summary of user actions?
To check the progress of an individual Vuser during a running test, you can
view a log file containing a text summary of the Vuser’s actions.
To review a text summary of the events:
Select a running Vuser in the Vusers window, and click the Show Vuser Log
button.
The Vuser log window opens.

The log contains messages that correspond to the actions of the Vuser. For
example, in the window above, the message “Virtual User Script started”
indicates the start of the scenario. Scroll to the bottom of the log and watch
as new messages are added for each action performed by the selected Vuser.
Note: The Vuser log will only contain information if you enabled the
logging feature in the Run-Time Settings Log tab.
Close the Vuser log window and the Vusers window.
How can I increase the load during the test?
You can increase the load on the application during a running load test by
manually adding more Vusers.
To increase load during a load test:
1 Click the Run/Stop Vusersbutton. The Run/Stop Vuser dialog box opens
displaying the number of Vusers currently assigned to run in the scenario.
2 In the # column, enter the number of additional Vusers to the group that
you want to add. To run 2 additional Vusers, replace the number 8 with the
number 2, in the # column.
3 Click Run to add the Vusers.
If some of the Vusers have not yet been initialized, the Run Initialized and
Run New options open. Select the Run New option

These 2 additional Vusers are distributed to the travel_agentgroup and are
run on the localhostload generator. The Scenario Status window shows that
there are now 10 running Vusers.

Note: You may get a warning message that LoadRunner Controller cannot
activate additional Vusers. This is caused by the fact that you are using your
local machine as a load generator and it has very limited memory resources.
In most situations you would use a dedicated machine as a load generator to
avoid such problems.
How is the application coping under load?
Check the Scenario Status window for a synopsis of the running scenario,
and drill down to see which Vuser actions are causing the application
problems. A high proportion of failed transactions and errors indicates that
the application is not performing as expected under load.
1 View the test status.
The Scenario Status window displays the overall status of the scenario.


2 View breakdown of Vuser actions.
Click the Passed Transactions link in the Scenario Status window to view a
list of transaction details. The Transactions dialog box opens.

Did the application encounter errors?
If an application starts to fail under heavy load, you are likely to encounter
errors and failed transactions. The Controller displays error messages in the
Output window.
1 Check for any error messages.
Click View > Show Output or click the Errors link in the Scenario Status
window.
The Output dialog box opens and lists a message text, the total number of
messages generated, the Vusers and load generators that generated the error,
and the scripts in which the errors occurred.
To view a message in detail, select the message and click Details. The
Detailed Message Text box opens, displaying the complete message text.
The example below shows a timeout error. The Web server is not responding
to a request within a given time period.

How do I know that the test has finished running?
At the conclusion of the test run, the Scenario Status window shows the
Down status. This indicates that the Vusers have stopped running.
You can look in the Vuser window to see the status of each individual Vuser.
LoadRunner displays the number of times a Vuser repeated a task (iteration),
the number of successful iterations, and the elapsed time.

Did the application perform well under load?
To see how well the application performed under load, you need to look at
the transaction response time and determine whether the transaction was
within an acceptable limit for the customer. If the transaction response time
degrades, you need to look for bottlenecks. You will learn more about this in
Lesson 10, “Analyzing your scenario.”
Once a problem has been isolated, a corroborative effort involving
developers, DBAs, network, and other systems experts is required to fix the
bottleneck. After adjustments are made, the load test is repeated to confirm
that the adjustments had the desired effect. You repeat this cycle to optimize
system performance.
To save the scenario so that you can run it again with the same settings,
clickFile > Save or click the Save button, and enter a scenario name in the
File name box.
Where To Go From Here
Now that you have learned how to run and view a simple load test scenario,
you can proceed to Lesson 9, “Advanced Goal-Oriented Scenario.”

No comments:

Post a Comment