Load Runner Notes
Load Runner Notes
Load Runner Notes
#1#
#2#
The actions that a Vuser performs during the scenario are described in a
Vuser script. When you run a scenario, each Vuser executes a Vuser script.
The Vuser scripts include functions that measure and record the performance
of the server during the scenario. To measure the performance of the server,
you define transactions.
Transactions measure the time that it takes for the server to respond to
tasks submitted by Vusers. For instance, you can define a transaction that
measures the time it takes for the server to process a request to view the
balance of an account and for the information to be displayed at the ATM.
You insert rendezvous points into Vuser scripts to emulate heavy user load on
the server.
Rendezvous points instruct multiple Vusers to perform tasks at exactly
the same time. For example, to emulate peak load on the bank server, you
insert a rendezvous point to instruct 100 Vusers to simultaneously deposit
cash into their accounts. You use the LoadRunner Controller to manage and
maintain your scenarios.
Using the Controller, you control all the Vusers in a scenario from a
single workstation. When you execute a scenario, the LoadRunner Controller
distributes each Vuser in the scenario to a host. The host is the machine that
executes the Vuser script, enabling the Vuser to emulate the actions of a
human user. Vuser scripts include functions that measure and record system
performance during load-testing sessions. During a scenario run, you can
monitor the network and server resources. Following a scenario run, you can
view performance analysis data in reports and graphs.
The LoadRunner Testing Process
You can easily create and run load-testing scenarios by following the
LoadRunner testing process below. The following illustration outlines the
testing process:
#3#
#4#
#5#
events that occur during each testing session. Thus, for example, a scenario
defines and controls the number of users to emulate, the actions that they
perform, and the machines on which they run their emulations.
Developing Vuser Scripts
LoadRunner has a variety of Vuser types, each type suited to a
particular load testing environment. This enables you to use Vusers to
accurately model and emulate real world situations. The actions that a Vuser
performs during the scenario are described in a Vuser script. The Vuser
scripts include functions that measure and record the performance of the
server during the scenario. Each Vuser type requires a particular type of
Vuser script. Creating the Vuser scripts required for a scenario is part of the
LoadRunner testing process.
Developing Vuser Scripts - Looking at Vuser Types
LoadRunner provides a variety of Vuser technologies that enable you to
generate
server load when using different types of client/server architectures. Each
Vuser technology is suited to a particular architecture, and results in a
specific type of Vuser. For example, you use RTE Vusers to operate terminal
emulators; TUXEDO Vusers to emulate TUXEDO clients communicating with a
TUXEDO application server; Web Vusers to emulate users operating Web
browsers. The various Vuser technologies can be used alone or together, to
create effective load testing scenarios.
The following table summarizes the use of the various Vuser types:
#6#
GUI Vusers
GUI Vusers operate graphical user interface (GUI) applications. These
applications can run in either the MS Windows or the X Windows
environments. Each GUI Vuser that you develop emulates a real user by
submitting input to, and receiving output from, GUI applications. For
example, a GUI Vuser could operate Microsoft Paint as follows:
1. Select Open from the File menu.
2. Select a graphic file called test.bmp.
3. Click the Open button.
4. Select Flip/Rotate from the Image menu.
5. Click the Flip Horizontal radio button.
6. Click the OK button.
7. Select Save from the File menu.
#7#
#8#
Because Database Vusers are not reliant on client software, you can use
Database Vusers to test server performance even before the client software
has been developed. Further, because Database Vusers do not have a user
interface, system resources are not used, and you can therefore run large
numbers of Database Vusers on a single workstation.
The following example illustrates the use of Database Vusers: Suppose
that you have a database server that maintains your customer information.
The information is accessed by numerous customer service personnel who
are located throughout the country. The database server receives the
queries, processes the requests, and returns responses to field personnel.
You want to test the response times of the server when numerous service
personnel simultaneously access the server. Using LoadRunner, you could
create several hundred Database Vusers, each Vuser accessing the server
database. The Database Vusers enable you to emulate and measure the
performance of your server under the load of many users. You develop a
Database Vuser script to define the actions of a Database Vuser. A Database
Vuser script includes functions that control the script execution, specify the
input that the Vuser submits to the server, and measure the server
performance.
You develop Database Vuser scripts either by recording with
LoadRunners Vuser Script Generator (VuGen) or by using LoadRunners
Vuser script templates. For the database server example above, you could
create a Database Vuser script that performs the following actions:
#9#
# 10 #
# 11 #
# 12 #
# 13 #
# 14 #
# 15 #
Perform the log off procedure. VuGen records the procedure into the
vuser_end section of the script.
Click Stop Recording on the Recording toolbar. The main VuGen window
displays all the recorded statements.
Click Save to save the recorded session. The Save As dialog box opens
(for new Vuser scripts only). Specify a script name.
After recording a script, you can manually edit the script in VuGens
main window. VuGen creates a series of configuration, data, and source code
files during recording . These files are used to execute the Vuser actions. You
can display the contents of each of these sections in the main VuGen
window. You can display the contents of only a single section at a time. To
display a section, highlight its name in the Sections box.
Enhancing Vuser Scripts
When you create a Vuser script, you can enhance its capabilities by adding
Vuser functions. For example, you can add debugging code, or functions that
Testing Tools LoadRunner
# 16 #
# 17 #
Click the arrow for a list of open transactions. Select the transaction to
close. Click OK to accept the transaction name. LoadRunner inserts an
lr_end_transaction statement into the Vuser script. For example, the
following function indicates the end of the trans1 transaction:
lr_end_transaction(trans1, LR_AUTO);
Inserting Rendezvous Points
To emulate heavy user load on your client/server system, you
synchronize Vusers to perform a task at exactly the same moment. You
ensure that multiple Vusers act simultaneously by creating a rendezvous
point. When a Vuser arrives at the rendezvous point, it is held by the
Controller until all Vusers participating in the rendezvous arrive. When the
rendezvous conditions are met, the Vusers are released by the Controller. You
designate the meeting place by inserting a rendezvous point into your Vuser
script. When a Vuser executes a script and encounters the rendezvous point,
script execution is paused and the Vuser waits for permission from the
Controller to continue. After the Vuser is released from the rendezvous, it
performs the next task in the script.
To insert a rendezvous point:
While recording a Vuser script, click the Rendezvous button on the
Recording toolbar. The Rendezvous dialog box opens.
# 18 #
Inserting Comments
VuGen allows you to insert comments between Vuser activities. You
can insert a comment to describe an activity or to provide information about
a specific operation. For example, if you are recording database actions, you
could insert a comment to mark the first query, such as This is the first
query.
To insert a comment:
While recording a script, click the Comment button on the Recording
tool bar. The Insert Comment dialog box opens.
# 19 #
# 20 #
# 21 #
A scenario describes the events that occur during each load testing
session. A scenario contains lists of hosts, Vusers, Vuser scripts, transactions,
and rendezvous points. You create a scenario using the LoadRunner
Controller. After you create the scenario, LoadRunner saves the information
in a scenario file (. lrs). You use the commands in the File menu to create,
open, save, and close scenario files. Some of these commands are available
from the toolbar.
Creating a New Scenario
The New command creates a completely new scenario. Note that the
New command clears all the information displayed in the Controller windows.
To create a new scenario, choose File > New, or click the New button.
You can also create a new scenario by using the Scenario wizard. The
wizard is an interactive, step-by-step guide to creating a scenario. To create a
new scenario by using the Scenario wizard, select File > Scenario Wizard.
Opening an Existing Scenario
The Open command opens any existing scenario.
To open an existing scenario:
Choose File > Open, or click the Open button. The File Open dialog box
opens.
# 22 #
Click a file in the File Name list or type a file name in the File Name
box.
Click OK. The File Open dialog box closes and the scenario appears in
the LoadRunner Controller.
Saving a Scenario
The Save command saves the current scenario.
Closing a Scenario
Closing a scenario closes all the Controller windows. To close the
scenario, choose File > Close. If you made changes to the scenario, a Save
Changes message appears. Choose Yes to save the changes you made. All
open windows and icons in the Controller close.
Filtering and Sorting Information
Each window in the LoadRunner Controller displays information about
the scenario. You can filter and sort the information that appears in each
window. Filtering information displays only those items that meet the
selected criteria. For example, you can filter the Vuser window to display only
those Vusers that are in the READY state. Sorting information displays all
the items in a list in a certain order. For example, you can sort all Vusers in
the Vuser list, in order of their Vuser ID number (1,2,3 etc.).
This section describes how to filter and sort the information displayed in the
Vuser window. Note that you cannot filter or sort the transactions displayed
in the Transaction window.
Testing Tools LoadRunner
# 23 #
Filtering Information
You use the Filters box to filter the information that appears in a
window. There is a Filters box in the toolbar in each window.
To filter information:
Click the arrow on the Filters list. The list of available filters appears.
# 24 #
# 25 #
Each time you run a scenario, some hosts may be unavailable. You can
temporarily remove (disable) hosts from the list.
Creating a Scenario Creating a Host List
Adding a Host to the Host List
You use the Host window in the LoadRunner Controller to add hosts to the
host list. After you create a host, you can set and modify the attributes for
the new host.
To add a host to the host list:
Start the LoadRunner Controller and open the Host window. The Host
menu appears in the LoadRunner menu bar.
Choose Host > Add. The Host Information dialog box opens.
# 26 #
# 27 #
# 28 #
# 29 #
# 30 #
# 31 #
To develop a scenario, you create a host list, a script list, and a Vuser
list. This describes how to create a script listthe list of all the Vuser scripts
that Vusers can run during scenario execution.
About Creating a Script List
A Vuser script defines the actions that a Vuser performs during
scenario execution. The script list contains all the Vuser scripts that Vusers
can run. The script list may contain scripts for GUI, DB, and RTE type Vusers.
The Script window, which displays the script list, has its own menu in the
Controller menu bar. The Script window includes the following information for
each script in the list:
# 32 #
Choose Script > Add. The Vuser Script Information dialog box opens.
Click the browse button to the right of the Path box. The Open dialog
box appears.
In the Files of Type box select the Vuser type, and then select the
path and file name of the new script.
Click Open to select the files. The Open dialog box closes, and the new
script name and its Vuser type appear in the Vuser Script Information
dialog box.
In the Command Line box, type any command line options to use when
running the script. For example: -x value -y value
To see the transactions declared in the selected script, click the
Transaction tab.
Testing Tools LoadRunner
# 33 #
# 34 #
# 35 #
Vuser script creates a GUI Vuser; selecting an RTE Vuser script creates an RTE
Vuser.
To create Vusers:
Start the LoadRunner Controller, display the Vuser window, and click in
the Vuser side of the window. The Vuser menu appears in the
LoadRunner menu bar.
Choose Vuser > Add. The Vuser Information dialog box appears.
In the Quantity box, enter the number of Vusers that you want to
create.
Select a host in the Host Name list. Select New to open the Host
Information dialog box and add a host to the list.
Select a script in the Script Name list. To see the rendezvous points and
transactions defined in the Vuser script, click the Script tab. To add a
new script to the list, click New to open the Vuser Script Information
dialog box.
Click OK to close the Virtual User Information dialog box. The new
Vusers appear in the Vuser window. LoadRunner assigns unique ID
numbers to the Vusers. If you did not create a Vuser Group,
LoadRunner creates the Vuser Group G1 and assigns the Vusers to it.
Testing Tools LoadRunner
# 36 #
Scheduling Vusers
After you create a Vuser, you can schedule the Vuser by setting:
The earliest time the Vuser can run
The amount of time after the scenario has begun that the Vuser will
start running
To schedule a Vuser:
Open the Vuser window, and click in the Vuser side of the window. The
Vuser menu appears in the LoadRunner menu bar.
Choose Vuser > Details. The Vuser Information dialog box appears.
Click the Scheduling tab.
# 37 #
In the Name box, enter the name of the Vuser Group and then click OK.
The new Vuser Group appears at the bottom of the Vuser Group list in
the Vuser window.
In the Command Line box, type any command line options to use when
running the group. For example: -x value -y value
Note: At run time, the Group command line options will be joined together
with any Vuser script command line options. If the Group and the script
specified the same option with different values, then the value defined for
the Group is used.
Testing Tools LoadRunner
# 38 #
Note: When you renumber Vusers, the Vusers are assigned new ID numbers.
This may conflict with previous results.
To renumber the Vusers within a Vuser Group:
Select the Vuser Group that you want to renumber.
Choose Group > Renumber. The Vusers in the selected group are
renumbered from 1.
# 39 #
Start Delays the start the Vuser Group when you run a scenario.
You enter the delay time in minutes. Note that if you delay the
start of a specific Vuser (via the Vuser Information dialog box),
the Vuser delay begins only after any Vuser Group delay time has
passed.
Run for Runs all the Vusers in the Vuser Group for a specified
amount of time from when the Vuser Group started. You enter
the time in minutes.
Click OK to close the dialog box.
# 40 #
# 41 #
To pause a Vuser:
Select the Vuser Groups or Vusers that you want to pause.
Choose Vuser > Pause, or click the Pause button. The Vusers are
paused.
Stopping Vusers
Stopping a Vuser stops script execution. If you stop a Vuser, the Vuser
still appears in the Vuser list.
To stop a Vuser:
Select the Vuser Groups or Vusers you want to stop.
Choose Vuser > Stop, or click the Stop button. The Vusers stop
executing their scripts.
Manually Releasing Vusers from a Rendezvous
While you run a scenario, you can manually release Vusers from a
rendezvous
before the Controller releases them.
To manually release Vusers from a rendezvous:
# 42 #
# 43 #
You can display scenario statistics by expanding the Vuser window. This
allows you to see how many Vusers in each Vuser Group are in the DOWN,
PENDING, INITIALIZING, READY, RUNNING, PAUSED, and RENDEZVOUS states.
# 44 #
The
The
The
The
The
# 45 #
Report Header
The header displays general scenario information.
# 46 #
# 47 #
This graph is useful for determining the Vuser load on your server at any
given moment. The x-axis represents the elapsed time (in seconds) since the
start of the scenario run. The y-axis represents the number of running Vusers
in the scenario. For example, the above graph indicates that there was a
maximum load of thirty Vusers. Until the 37th second of the scenario run,
Vusers were gradually loading. Thereafter, the number of running Vusers
decreased to twenty, and then to ten.
Rendezvous Graph and Report
The Rendezvous graph indicates when Vusers were released from
rendezvous points, and how many Vusers were released at each point. This
graph helps you understand transaction performance times. If you compare
the Rendezvous graph to the Transaction Performance graph, you can see
how the load peak created by a rendezvous influences transaction times.
# 48 #
11:54:11
11:55:06
Members
50
Released
40
# 49 #
Query_md
Vuser
Query_md
OK
Query_md
Time out
11:55:11
11:55:42
50
10
11:55:43
11:56:01
50
50
11:56:19
11:57:21
50
48
by
In the above report, the rendezvous policy was set to All Arrived,
requiring all 50 Vusers to arrive at the rendezvous point. In the first
rendezvous, 40 Vusers were released after the timeout period while 10
Vusers were manually released by the operator. In the next rendezvous, all
50 Vusers arrived. In the last rendezvous, two Vusers never arrived, causing
the others to reach the timeout.
Transactions per Second Graph (Passed)
The Transactions per Second (Passed) graph displays the number of
completed, successful transactions performed during each second of a
scenario run. This graph helps you determine the actual transaction load on
your system at any given moment. You can compare this graph to the
Transaction Performance graph in order to analyze the effect of the number
of transactions on the performance time.
# 50 #
The x-axis represents the elapsed time (in seconds) since the start of
the scenario run. The y-axis represents the number of transactions
successfully performed during the scenario run. For example, the above
graphs indicate that in the 224 th second of the scenario, nine query
transactions were successfully completed. The response time at that point
was 49 seconds.
Failed Transactions Graph and Report
The Transactions per Second (Failed) graph displays the number of
completed, unsuccessful transactions performed during each second of the
scenario run. This graph contains information about transactions that were
assigned an LR_FAIL value in the lr_end_transaction statement.
Note: The lr_end_transaction statement must be executed in order to
generate the Failed Transaction graph. If your program aborts immediately
upon an error, all current transactions are terminatedno data is generated
for failed transactions.
The following example uses a Web Vuser script. Web Vuser statements return
zero for success and a positive value for failure. The Web Vuser script below
tries to access an HTML page using a GET statement. If the GET request
succeeds, the script assigns the LR_PASS status to the transaction. If the GET
request fails, the script assigns LR_FAIL to the transaction. On the
Transactions per Second (Failed) graph, the x-axis represents the elapsed
time (in seconds) since the start of the scenario run. The y-axis represents
the number of transactions unsuccessfully performed during the scenario.
lr_start_transaction(wizard);
if (URL("http://www.wizard.com/index.html") == 0)
lr_end_transaction(wizard, LR_PASS);
else {
lr_end_transaction(wizard, LR_FAIL);
lr_log_message("Wizard home page not returned");
}
# 51 #
For example, the above graph indicates that in the 33rd second of the
scenario, nine insert_row transactions failed. The Failed Transaction report
provides detailed information about the beginning, end, and duration of the
failed, yet completed transaction.
# 52 #
In this scenario, one Vuser failed, two had errors, and three were
aborted.
Scenario Execution Report
The Scenario Execution report details the major events that occurred
during the scenario run. This includes information on every Vuser, such as
when it was ready to run and for how long it ran.
# 53 #
# 54 #
# 55 #
The x-axis indicates the number of running Vusers, and the y-axis
indicates average transaction time in seconds. In the above graph, the
execution time for the top_sales transaction increases with the number of
running Vusers. For twenty running Vusers, the response time for the
transaction was 3.5 seconds.
Analyzing Scenario Performance
The Performance Under Load Graph indicates transaction times relative
to the number of Vusers running at any given point during the scenario. In
order for this graph to be meaningful, the performance is calculated when
there is a stable load (constant number of running Vusers) for at least five
seconds (by default). If the Vuser load is not stable for at least five seconds,
the transaction time is not calculated and the graph will indicate zero.
For example, a scenario with a load of 50 to 70 Vusers had an average
performance of 10 seconds, but its graph displayed zero. This occurred
because the Vusers did not stabilize for five seconds. You can instruct
LoadRunner to measure transaction time for shorter periods of steady load.
To change the Performance Under Load interval:
Choose Options > Performance Under Load Interval in the Analysis
window.
# 56 #
# 57 #
# 58 #
5, and 10 (from top to bottom). The lower the granularity, the more detailed
the results. However, it may be useful to view the results with a higher
granularity to study the overall Vuser behavior throughout the scenario. For
example, using a low granularity as in the upper graph, you see the intervals
when no transactions were performed. By viewing the same graph with a
higher granularity, you can easily see that the overall transaction response
time averaged 3.5 seconds.
# 59 #
The x-axis specifies the name of the transaction. The y-axis shows the
time, rounded off to the nearest second, taken to perform each transaction.
For example, the above graph displays the statistics of the query transaction.
The transaction was performed in a minimum time of 24 seconds, an
average time of 36 seconds, and a maximum time of 42 seconds.
The report shows similar information in table form. The information in
the table is not rounded off to the nearest second, as it is in the graph.
# 60 #
The x-axis specifies the name of the Vuser and the Group to which it
belongs. The y-axis shows the time, in seconds, it takes to perform each
transaction. For example, the above graph displays transaction processing
times for the Vusers in the group15. Vuser two performed the query
transaction in a minimum of 25 seconds, an average of 32 seconds, and a
maximum of 40 seconds.
The Performance Summary by Vuser report shows similar information
for each
Vuser in table format.
# 61 #
# 62 #
The Start time and the End time in this report refer to the system time
at the beginning and end of a transaction. The Result field contains the final
transaction status, either Pass or Fail.
# 63 #