Академический Документы
Профессиональный Документы
Культура Документы
This component is used to generate the script for each business process or scenario with the
supported protocol.
Protocol Advisor:
This is a new feature of Load Runner 9.5 and it identifies the supported protocols by the application
under test or the business process.
WebTours URL
http://127.0.0.1:1080/WebTours/
username/password : jojo/bean
By using a protocol advisor, we identified the below types of protocols that supports for the application
business proces.
Ajax (click and script)
Web (HTTP/HTML)
Selecting an appropriate protocol:
1. Protocol advisor has identified two protocols supported by application under test but we have
to use only one protocol for performance testing.
2. It would be better to go with Web protocol first and then go for ajax if it does not support web
lets
3. The reasons to select web protocol is quite obvious, the licence cost for generating virtual
users is of ration 1:10 for web and ajax and also memory constraints, Web protocol consume
2MB where as Ajax protocol consumes 10 MB per virtual user
Select the protocol as web (HTTP/HTML) to generate the script:
Recording Modes:
3.
It generates separate web functions for each non html resource on a web page.
Functions it supports are Web_url, web_submit_url, web_custom_request
Note: It is recommended to user html based recording over url based recording as it focuses on user
actions.
Correlation:
Automatic Correlation
Manual Correlation
Automatic Correlation: Handle server generated data with the help of tool functionalities is called
automatic correlation
1. Scan script for correlation generate the script for end to end business scenario, run the script
and I observed a problem in handling sessions ids generated by the script ie an error with
session while logging into application.
2. Select > View > Scan Script for correlation> The differentiate values between the recording
and replay will display under correlation results
3.
4.
5.
Manual Correlation:
1.
Identify correlated values: record same scenario twice and save each script. Go to
Tools>Compare with Script from one of the saved scripts, a dialog will open, now select the
other script. A file with differences between the two scripts is displayed ie..Wdiff. From the
Wdiff we can figure out the values that could be correlated. The differences are are highlighted
in yellow lines.
Identify the required correlated value from the differences, important thing to note while
comparison is that only server generated values have to be considered for correlation, not all the
differences such as think time, x-y co-ordinates.
2.
Search for the correlated value in the response, identify the left boundary and right boundary
of the correlated value.
Then identify the ordinal value of the correlated value, ie. Search if there are similar tags
existing in the response with same left and right boundary, if exists then list them down in the
notepad.
Then, the position in which the correlated value is nothing but ord value
Go to script view, insert the correlated function with all the arguments before the previous
request.
web_reg_save_param("sessionID","LB=<input type=hidden name=userSession
value=","RB=>","ORD=3",LAST);
3.
4.
When you replay the script the given parameter will capture the data at run time
Save it into variable: By default it saves the new value into the given parameter for a specific
ord number
ii) we need to save a required value into the separate variable whenever ord = all
Replace the variable at all the places of original values in the script.
Replay the script and verify the log as well as results file
When you user ord = all, correlated parameter captures list of values in an array. So, use the
below randomized function to select the random value from the array. It captures a specific index value
from the array list
lr_parmarr_idx(arrayparameter, index)
lr_parmarr_random(arrayparameter) It takes a random value from the available array range
lr_paramarr_len (arrayparameter) Returns the length of the array passed as parameter
Note: all the above array functions are available from loadrunner 9.5
1.
2.
To calculate the length of the given array use the below syntax
arrPrmcnt = atoi(lr_eval_string(arrayparm_count));
cityCount = atoi(lr_eval_string("{city_count}"));
To select a random value from the available range use the below syntax
cityCount = atoi(lr_eval_string("{city_count}"));
city:
rndNum1 = rand()%cityCount+1;
rndNum2 = rand()%cityCount+1;
sprintf(fromCityParm,"{city_%d}",rndNum1);
sprintf(toCityParm,"{city_%d}",rndNum2);
sprintf(toCity,"%s",lr_eval_string(toCityParm));
Parameterization:
Passing different set of inputs instead of original values in the script
Sequential each iteration: Parameterize a value in the script, ie.. select a value in the script,
right click on the value and select replace with parameter, a dialog opens with multiple options, enter
the parameter name and select file as parameter type.
GoTo > vusers>Parameters list, a dialog with all the parameters would be listed. Select the
parameter created above, and click edit with note pad option and give multiple values and then save
it. All the multiple values given in the note pad are reflected in the parameter list dialog.
Then select next row as sequential and update value on as each iteration and then click
Simulate Parameter button.
Parameter simulation daialog is opened.
Select number of virtual users and Number of iternations to run and click on simulate button.
If above screen shot is observed, for each iteration the vusers are same, this is the drawback of
sequential iterations iefor each iteration the vuser would be sequentially assigned but the vusers are
same in each iteration.
Sequential Once
Then select next row as sequential and update value on as Once and then click Simulate
Parameter button.A single sequential parameter value will be assigned for all the iterations done by
the vuser
Note: In all the sequential combinations the data which is passed for the first vuser, the same
date would be assigned to remaining vusers.
Random Once:
Then select next row as Random and update value on as Once and then click Simulate
Parameter button.
A single random parameter value would be assigned for all the iterations done by the vuser
Block Size:
Allocate the block size for each user based on the iterations
File Size:
Allocate the parameter values in a file based on number of users and iterations for example if
there are 5 vusers in 10 iterations, the file size should be 5*10 i.e. 50
Unique Once
A single parameter value would be assigned for all the iterations done by the vuser
Each Occurrence: When same Parameter is used multiple times in an action, each occurrence would
send different data for every occurrence.
It would update a new parameter value for each occurrence of the parameter file in the script.
Transaction Points:
Insert transaction points to measure the response time of user actions.
Start Transaction:
lr_start_transaction(*char parmName):
ApplicationName_ScenarioName_TransactionNum_Action
End Transaction:
Lr_end_transaction(transactionname,status):
LR_AUTO: Automatically returns the status of end transaction, either pass or fail or stop.
LR_PASS: Returns the status as PASS
LR_FAIL: Returns the status as FAIL
Check Points:
Two types of check points are available in load runner
Text Check Point Validates the given text on a web page using two functions
Web_reg_find(textToFind) : One type of check function to validate, this function we user
savecount argument to capture the occurrence of the given text on a web page.
Web_find(): It is also one type of text check functions to validate the given text on a
web page.
Syntax: Web_find(stepname,what=textToVerifty,LAST)
Web_reg_find
It records the title of the page by default
by havig advance option in record setting
This function is written before the action
functions or befor requesting server
No need to enable any option to verify
during script run or play back
web_find
No option is available to record the text by
default during script recording
This function is written after the action
functions or after requesting server
We need to enable, Image and text check in
Runtime Settings > Internet Protocol>
Preferences > Enable Image and text check
CONTROLLER:
In this component we will design and execute the multi user performance business secenarios
There are two types of scenarios can be designed in load controller scenario.
1) Manual Scenario
2) 2) Goal Oriented Scenario
Manual Scenario:
Create the controller scenario based on the number of virtual users
Goal Oriented Scenario:
Create the controller scenario based on the below specified goal
Goal Types:
1.
2.
3.
4.
5.
Virtual Users
Hits per Second
Transactions per Second
Transaction Response Time
Pages per Minute
Upload all the scripts into the controller which are in scope.
Define the vuser load for each script(user mix)
Assign the load generator to generate vusers load(How many users should be generated on a
load generator?)
How do you define how many load generators to be used, and how many users should be used
on the generator?
Load generators gernerates the amount of vusers to run the script to simulate real word
behavior. Based on system configuration of load generator machine generates the load from
each load generator.
Configuration: for web protocol the recommended users are 1 for 2MB of RAM and for 2GB 500
members. 50% of the memory is used for virtual users and 50% for services to run.
Load generator can be configured either in windows or in Unix
We can configure load generator from other machines in a controller. Some times its fail to
connect to the destination PCs load runner the possible reasons could be either the machine
with the given ip address is not started or the agent process software is either not installed or
not running on the destination machine.
Assigning the multiple load generators into a single script:
a. We will add the same script and assign each load generator
b. We will assign the multiple load generators into a single line of script using a coma
separator
Select the script, click on
Load runner VTS(Virtal Table Server): we want to run single script on three different
generators, we place the user data on vts server. When first vuser of the first load
generator he picks the usernames from the vts server but when the second vuser comes,
4.
the first user in vts table gets deleted and second vuser would replace it and the vuser
takes the first row.
Define the standard runtime settings for each script
a) Run Logic: To Define the number of iterations for Actions not and it will not be applicable
for Init and End method of the script.
Block Iterations:
Number iterations set above ie 20 is applicable for all the action, the above script has only
one action even if there are multiple actions in the script the same number of iterations are
applicable to the actions.
Running different actions in the script with different iterations, to do that first delete all the
actions from the run time settings, I mean only from run time settings, not from the script.
Then insert blocks equal to the number of actions in the script using Insert Block button,
now right click on the block and insert one action each.
After inserting actions to the blocks, right click the action and select Properties option, then
the in the dialog box displayed give the block iterations.
Pacing:
It is the user waiting time between the iteration executions.
Log:
It captures the behavior of script execution into a log file,
Note: The recommended log option is send messages only when an error orrurs.
Think Time:
Its a user waiting time between the transaction executions.
Miscellaneous:
1.
Error Handling
a. Continue on error
b. Fail open transactions on lr_error_message
c. Generate Snapshot on error
Multithreading
a. Run Vuser as a process In process oriented communication; each vuser will be
generated using a separate driver program.
It consumes more system resources, for multiple .exes
b.
Speed Simulation: In this we can select the bandwidth to user in the executions.
Browser Emulation:
Proxy:
A proxy is a middleware server to validate the request and responses from one network to another
network
Preferences:
Download filters:
1.
Content Check: It is used to verify the given text on all the user accessing web pages
5.
6.
Defien RampUp time: RampUp- It initializes the vusers and server with the given interval time.
We can set rampup from the
Simultaneously: It initializes all the vusers on the server at the same time
Slow RampUp: It initializes the given amount of users on server with the specified interval time
We can give the ramp up by clicking on start vusers in the global schedule.Z
Note: Always the recommended option is slow rampup
Define the steady state period to run all vusers on server
Run until completion: it runs vusers on server until completion of the iterations.
Note: We need to define the fixed number of iterations to design the scenario for run until
completion.
Run for duration: It runs all the vusers on server with the given time duration.
Note: In this case its not necessary to specify iterations because it will automatically repeat
the iteration for given time duration.
7.
ArabianBank_100Users_LoadTest_12072011
Ip Spoofing:
It assigns one ip address to each virtual user running in the execution.
a.
b.
Select Windows Resources option under Available graphs or drag the option and drop it on the
graph
Right click on the Windows Resources option, select Add Measurements option
Addd Server machine details in Window Resources dialog, i.e..ipaddress and login details of
the system in which the server is set up.
Counters
% idle time
% privileged
time
% processor
time
% user time
Interrupts/sec
Description
% Idle Time is the percentage of time the processor is idle during the
sample interval
% Privileged Time is the percentage of elapsed time that the process
threads spent executing code in privileged mode. When a Windows
system service in called, the service will often run in privileged mode to
gain access to system-private data. Such data is protected from access by
threads executing in user mode. Calls to the system can be explicit or
implicit, such as page faults or interrupts. Unlike some early operating
systems, Windows uses process boundaries for subsystem protection in
addition to the traditional protection of user and privileged modes. Some
work done by Windows on behalf of the application might appear in other
subsystem processes in addition to the privileged time in the process.
% Processor Time is the percentage of elapsed time that the processor
spends to execute a non-Idle thread. It is calculated by measuring the
duration of the idle thread is active in the sample interval, and subtracting
that time from interval duration. (Each processor has an idle thread that
consumes cycles when no other threads are ready to run). This counter is
the primary indicator of processor activity, and displays the average
percentage of busy time observed during the sample interval. It is
calculated by monitoring the time that the service is inactive, and
subtracting that value from 100%.
% User Time is the percentage of elapsed time the processor spends in the
user mode. User mode is a restricted processing mode designed for
applications, environment subsystems, and integral subsystems. The
alternative, privileged mode, is designed for operating system components
and allows direct access to hardware and all memory. The operating
system switches application threads to privileged mode to access
operating system services. This counter displays the average busy time as
a percentage of the sample time.
Interrupts/sec is the average rate, in incidents per second, at which the
processor received and serviced hardware interrupts. It does not include
deferred procedure calls (DPCs), which are counted separately. This value
is an indirect indicator of the activity of devices that generate interrupts,
such as the system clock, the mouse, disk drivers, data communication
lines, network interface cards, and other peripheral devices. These devices
normally interrupt the processor when they have completed a task or
require attention. Normal thread execution is suspended. The system clock
typically interrupts the processor every 10 milliseconds, creating a
Memor
y
Available
Mbytes
Committed
Bytes
% Committed
Bytes in use
Page
Faults/sec
Page
reads/sec
Page
writes/sec
Page
Input/sec
Page
Output/sec
Pages/sec
Pool
Nonpaged
Allocs
Pool
Nonpaged
Bytes
Pool Paged
allocs
Pool paged
Bytes
Physica
l disk
% disk time
% idle time
Avg. disk read
queue length
Avg. disk
write queue
length
Current disk
queue length
Proces
s
% processor
time
in short supply. This counter shows the number of pages, and can be
compared to other counts of pages, without conversion.
Pages/sec is the rate at which pages are read from or written to disk to
resolve hard page faults. This counter is a primary indicator of the kinds of
faults that cause system-wide delays. It is the sum of Memory\\Pages
Input/sec and Memory\\Pages Output/sec. It is counted in numbers of
pages, so it can be compared to other counts of pages, such as
Memory\\Page Faults/sec, without conversion. It includes pages retrieved
to satisfy faults in the file system cache (usually requested by
applications) non-cached mapped memory files.
Pool Nonpaged Allocs is the number of calls to allocate space in the
nonpaged pool. The nonpaged pool is an area of system memory area for
objects that cannot be written to disk, and must remain in physical
memory as long as they are allocated. It is measured in numbers of calls
to allocate space, regardless of the amount of space allocated in each call.
This counter displays the last observed value only; it is not an average.
Pool Nonpaged Bytes is the size, in bytes, of the nonpaged pool, an area of
system memory (physical memory used by the operating system) for
objects that cannot be written to disk, but must remain in physical
memory as long as they are allocated. Memory\\Pool Nonpaged Bytes is
calculated differently than Process\\Pool Nonpaged Bytes, so it might not
equal Process\\Pool Nonpaged Bytes\\_Total. This counter displays the last
observed value only; it is not an average.
Pool Paged Allocs is the number of calls to allocate space in the paged
pool. The paged pool is an area of system memory (physical memory used
by the operating system) for objects that can be written to disk when they
are not being used. It is measured in numbers of calls to allocate space,
regardless of the amount of space allocated in each call. This counter
displays the last observed value only; it is not an average.
Pool Paged Bytes is the size, in bytes, of the paged pool, an area of system
memory (physical memory used by the operating system) for objects that
can be written to disk when they are not being used. Memory\\Pool Paged
Bytes is calculated differently than Process\\Pool Paged Bytes, so it might
not equal Process\\Pool Paged Bytes\\_Total. This counter displays the last
observed value only; it is not an average.
% Disk Time is the percentage of elapsed time that the selected disk drive
was busy servicing read or write requests.
% Idle Time reports the percentage of time during the sample interval that
the disk was idle.
Avg. Disk Read Queue Length is the average number of read requests that
were queued for the selected disk during the sample interval.
Avg. Disk Write Queue Length is the average number of write requests
that were queued for the selected disk during the sample interval.
Current Disk Queue Length is the number of requests outstanding on the
disk at the time the performance data is collected. It also includes
requests in service at the time of the collection. This is a instantaneous
snapshot, not an average over the time interval. Multi-spindle disk devices
can have multiple requests that are active at one time, but other
concurrent requests are awaiting service. This counter might reflect a
transitory high or low queue length, but if there is a sustained load on the
disk drive, it is likely that this will be consistently high. Requests
experience delays proportional to the length of this queue minus the
number of spindles on the disks. For good performance, this difference
should average less than two.
% Processor Time is the percentage of elapsed time that all of process
threads used the processor to execution instructions. An instruction is the
basic unit of execution in a computer, a thread is the object that executes
instructions, and a process is the object created when a program is run.
Code executed to handle some hardware interrupts and trap conditions
Private bytes
Virtual bytes
Working set
System
Processor
queue length
Processes
Threads
TCPv4
Connection
failures
Connections
active
Connections
established
IP spoofing
Object
Processor
Memory
Counters
% idle time
% privileged time
% processor time
% user time
Interrupts/sec
Available Mbytes
Committed Bytes
% Committed Bytes in use
Instances
All instances
No instances
Physical disk
Process
System
TCPv4
Page Faults/sec
Page reads/sec
Page writes/sec
Page Input/sec
Page Output/sec
Pages/sec
Pool Nonpaged Allocs
Pool Nonpaged Bytes
Pool Paged allocs
Pool paged Bytes
% disk time
% idle time
Avg. disk read queue
length
Avg. disk write queue
length
Current disk queue length
% processor time
Private bytes
Virtual bytes
Working set
Processor queue length
Processes
Threads
Connection failures
Connections active
Connections established
All instances
All instances
No instances
No instances
CPU Utilization
System Mode CPU Utilization
User mode CPU utilization
Interrupt rate
Page in Rate
Page out rate
Paging rate
Memory
Swap in rate
Swap out rate
Average Load
Collision Rate
Context switch rate
Disk Traffic
Incoming Packets error rate
Incoming packets rate
Outgoing Packets error rate
Outgoing packets rate
Counter
CPU Utilization
Description
Percent of time that the CPU is utilized.
Paging Rate
Swap-in-rate
Swap-out-rate
Average Load
Collision Rate
Context Switch Rate
Disk Traffic
Incoming Packets error
rate
Incoming Packets rate
Outgoing Packets error
rate
Outgoing Packets rate
Note: To collect the UNIX resources through a controller, rstat daemon process should run in Unix box.
Note: UNIX does not have a built in utility to monitor the counters, we have to run different scripts in
Unix to monitor the performance counters.
Unix Performance Monitoring using shell files:
1.
2.
3.
4.
Note: To Copy the data from Unix machine to Windows machine and vice versa use WinScp utility.