|
| Topics this page: |
|
|
| This script overcomes several specific limitations in the LoadRunner product: | Solution |
|---|---|
| Automatic Transaction Names |
| Response Evaluation and Display |
| Message Formatting |
| Transaction Logging |
| Web Services Diagnostic Stats. |
| Retry Logic |
| Keyword Driven Control Data Run Logic |
| Random Execution |
| Transaction Time Boxing |
| Keyword Driven Logic |
This framework makes irrelevant several limitations to using the advanced Eclipse IDE to edit and compile LoadRunner scripts, because the framework handles run-time and parameter settings from a spreadsheet read by the framework.
The Eclipse platform also cannot step through LoadRunner scripts as they execute. But the framework also makes that mostly irrelevant because the framework enables stop points and changes to verbosity to be specified between any individual action.
|
|
|
|
|
|
|
|
|
| Object | Captured into Parameter |
|---|---|
| Page Title | {pageTitle_...} |
| Redirected URL | {pRedirectedURL_...} |
| Character Set ("iso-8859-1", "UTF-8") | {pRetCharset} |
| Response Header | {pResponseHeaders} |
| Response Body | {pResponseBody} |
| Response Header and Body | {pResponseFile} |
These are in addition to the response time and bytes downloaded from each request.
If no web_... function is defined between startTrans() and endTrans(),
LoadRunner issues an error message about "web_reg_param" not used.
So in such a case, instead of startTrans() and endTrans(), code this function:
wi_stubTrans();
Additionally, the wi_endTrans() functions will make a request to the Diagnostic web service if the "ProbeShow" attribute is set to "Y".
|
|
| Key ratios DBAs use to manage Oracle are calculated by this framework:
These ratios depend on having SiteScope edited to report:
consistent gets
SiteScope should also be edited to report
|
|
|
| Minimum | Average | Median | Maximum | 90% | Std.Dev. |
|---|
(The median is not shown by the Controller Run tab because that can only be calculated after all values are available at the end of the run.)
The trouble with these common statistical measures is that they do not reflect
the standard specified in SLA (Service Level Agreements), which have definitions of
unacceptable response time such as "4 seconds 90% of the time (including WAN traffic time)".
The "90%" reported by LoadRunner is calculated from response times collected throughout the entiraty of a particular run. LoadRunner does not report whether transactions met its performance criteria at various times as loads vary throughout a run.
These shortcommings are resolved by a customer-oriented statistic recently developed by the apdex alliance created and led by Peter Sevcik of NetForecat.
LoadRunner does not calculate this because it's so new. But this framework does calculate it and report it as a user-defined metric.
The apdex (application performance index) reflects the ratio of measurements over a period of time that meet (or nearly meet) performance thresholds. I say "nearly meet" because Apdex gives "half credit" to individual response time measurements that is between two performance standards:
Beyond this point, measurements are not counted as part of the index.
On graphs, excellent performance numbers are shown higher than unacceptable performance numbers.
Because the apdex is geared toward production performance monitoring, which yields stats
summarized by day, week, month, the
Apdex specification v1.1 considers sample sizes of 100 per index value normal.
It asks that smaller sample sizes be marked with an asterisk.
|
| || | Time Stamp | || | Transaction | || | Type | || | Seconds | || | Response KB | || | KB/Sec | || | X | || | XKB | || | Note | || |
| | | 070304071113S0GNoneU-1 I2A1D3T1S1 | | | img/au.gif | | | image/gif | | | 0.617 | | | 1.406 | | | 2.3 | | | 1.4X | | | 1.0 | | | - | | |
For convenience, the elapsed time and amount of data captured from returning transactions is expressed in seconds and KiloBytes rather than the milliseconds and individual bytes. "KB" is 1024 bytes.
The "KB/Sec" column provides a rough calculation for a general estimation. This is of course way low becuase it includes server processing time plus transmission time.
The "X" column is the number of times the actual bytes returned versus the expected number of bytes specified in the Driver Bytes column. For example:
The "XKB" column reports the bytes expected after convertion to KiloBytes.
"Y" in the OutputCsvLog attribute will allow the output of comma separate values
in a ".csv" (comma separated) file for import into Excel
This is done after every driver control record is processed, whether it was success or not.
| ||||||||||||||||||||
| 1.requested "Think" time before transaction requests | 6.lr_ start trans | - | 5.Actual response time | - | 7.lr_ end trans | 10."Wait" time to fulfill remainder of TimeBox seconds. | ||||
| 2.pause BetweenTriesSecs from previous retry (if any) | 3.pre-trans framework "overhead" Time | 4.lr_ think time | 8.Wasted start time | - | 9.Wasted end time | 11.System monitoring "probe" time (if any) | 12. lr_think time | |||
If a transaction takes longer than the time box time, an error message is issued and time is taken away from the next transaction's wait time. This is an attempt to keep the intended schedule by "making up" for the extra time. An excessive number of these errors of course means that the time boxes should be longer.
Time boxing behaviour is on by default. To disenable it, add a "TimeBox" run-time attribute with a value of "N".
This is time the script waits if the server does not repond.
A value of "defaults" sets the timeouts to 120 seconds.
A value of "min" sets the timeouts to 10 seconds.
This script overrides these settings to the value of TimeBox Wait seconds to avoid creating time outs.
|
|
This sample script is driven by a parameter (.csv or .dat) file.
When opened with Notepad or other text processing program, the file looks like this:
|
| U | TT | Rand | Trans | Think | Act | Timebox | Node | Info1 | Info2 | Info3 | Bytes | Tries | Note | Seq |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ParmSet | Version_PubID | 1826102 | 1 | |||||||||||
| Y | 01_URL | URL | http://dev... | Hello | 12342 | 2 | ||||||||
| N | 01_URL | URL | http://pe... | Sometimes | 12342 | 3 | 3 | |||||||
| 02_Login | Login | 6 | me | password1 | 36823 | 4 | ||||||||
| Y | 95 | Home | Custom | Spec | a21.htm | Cool | 56342 | X 2 | frames | 2 | ||||
| else | Abandon | 5 | ||||||||||||
| 70 | 99_Logout | 2 | Logout | Logout | 36213 | 6 |
Whenever the Action script encounters any value other than NULL or "Y" in the first column,
that row is skipped and processing continues to the next row.
This value is limited to 1 character.
|
|
|
|
|
|
|
|
|
|
|
| Functionality | In wi_lib.c | Application-specific Functions in wi_app.c |
|---|---|---|
| Initialize variables during vuser_init phase | wi_vuser_init_vars() wi_attr_set() | wi_app_init() wi_app_var_set() |
| Initialize variables during each Action iteration | wi_action_Keyword_loop(), wi_action_init() | wi_app_action_iteration_init() |
| Close files and cleanup at end of run | wi_vuser_end() | - |
| Process Driver parameter requests | wi_process_driver_ext_rec() and wi_process_driver_attr_rec() within
wi_process_driver_tries() within wi_process_driver_rec() within wi_action_Keyword_loop() | wi_app_act_modules() |
| control of transactions | wi_stubTrans() wi_assemble_CurrentTrans() wi_startTrans() wi_startTransName() wi_endTrans() wi_startSubTrans() wi_endSubTrans() wi_startTotal() wi_endTotal() | - |
| printing of messages | wi_startPrinting() wi_stopPrinting() wi_printMessage() wi_print_DriverRec_details() | - |
| evaluation of responses | wi_startScreen() wi_evalScreen() wi_PrintHttpStats() wi_endScreen() wi_clearScreenInfo() catchResponseToFile() wi_saveImgToFile() wi_replaceCharSeparators() | wi_app_startScreen() wi_app_evalScreen() wi_app_evalScreenTitle() |
| output of logs | wi_CsvLogOpen() wi_CsvLogClose() wi_WikiLogOpen() wi_WikiLogClose(), wi_CsvLogHeaderWrite() wi_WikiLogHeaderWrite() wi_CsvLogRowWrite() wi_WikiLogRowWrite() | - |
| Diagnostics | wi_SvcDiag_init() wi_SvcDiag_request() | - |
| Virtual Table Server | wi_vts_init() wi_vts_request() | - |
Note that the names of functions in the script all begin with the name of the action file where they reside.
Functions return values using static variables LR_PASS, LR_FAIL, UNKNOWN.
|
| Defined in... | Run-time Attribute | Description | Default | Source Marker | Max Chars |
|---|---|---|---|---|---|
| wi_app.c | EnvID | A number associated with each particular value of the {pURLHostPath} parameter that includes the protocol (http/https), IP/DNS name, port, and folder of the targeted environment. | 1 | {21} | 4 |
| ScriptType | "Keyword" for using the DriverParms.csv file, "KeepAlive", "DiagLoo" for only diagnostics. | Keyword | {22} | 16 | |
| CleanUpFirst | "Y" to invoke data clean-up during vuser_init phase, if defined. | "N" | {29} | 1 | |
| CleanUpAfter | "Y" to invoke data clean-up during vuser_end phase, if defined. | "N" | {30} | 1 | |
| wi_lib.c | Verbosity | A code which specifies the extent of detail appearing in logs. | 4 | {4} | 1 |
| TimeBox | "Y" uses the "Tries" column of each transaction control file as the number of seconds that all transaction will take every time (for a controlled processing rate). Vusers are main to wait after each transaction until this time passes. | "N" | {5} | 1 | |
| TimeBoxSecs | The number of seconds that all transaction will take every time (for a controlled processing rate). Vusers wait after each transaction until this time passes. Non-negative numbers in the Driver "Timebox" column override this number. | Y | {5} | 1 | |
| Randomly | "Y" to use the "Rand" column value to determine whether. | Y | {10} | 1 | |
| RandTries | "Y" resets the randomizer for each try repeating a driver row. | "N" | {10} | 1 | |
| ProcessPct | "100" to process every row of the control parms, "0" to never process that row. | 100 | {10} | 4 | |
| TaskType | A value such as "LT" would skip all non-blank rows which do not contain that value. | blank | {10} | 16 | |
| ThinkBefore | "Y" to add think time before transactions. If a Think value is not specified in the driver row, the ThinkSecs attribute value is used. | "Y" | {10} | 1 | |
| ThinkSecs | Number of seconds to pause every transaction before invoking the request. This is overriden by specifications in the "Think" column. This can contain a decimal (such as "3.2"). | 0 | {12} | 8 | |
| ThinkTimeRandomRange | The percent that think times defined in the driver Think column can be randomized. "50"(%) means that a 10 second think time can range between 5 seconds and 15 seconds. A range of 100 percent means a range between no seconds and double the think time specified. A zero range (the default) means no randomization and the think time as specified is used. | 0 | {12} | 4 | |
| TransNamePrefix | Text to pre-pend to the transaction name specified in the "Trans" driver parameter column. | blank | {11} | 8 | |
| TransNameSuffix | Text to append to the transaction name specified in the "Trans" driver parameter column. | blank | {11} | 8 | |
| CompareBytes | "Y" compares the number of bytes returned as a multiple of the bytes expected. | "N" | {13} | 8 | |
| MaxBytesDiff | The maximum difference in the number of bytes returned vs. the bytes expected before an error message is issued. | 300 | {13} | 8 | |
| OutputCsvLog | "Y" to write out a csv log for each transaction. Any other value will not. | "N" | {15} | 1 | |
| OutputWikiLog | "Y" to write out a txt file containing wiki markup. | "N" | {15} | 1 | |
| ShowSubTrans | "N" to not report sub transaction results (only transaction summary and total results). | "Y" | {15} | 1 | |
| OutputInfoToWiki | "Y" to write out "info" messages to the Wiki log. | Y | {15} | 1 | |
| OutputLogFolder | Blank defaults to C:\\Documents and Settings\\userid\\Local Settings\\Temp | "N" | {15} | 1 | |
| OutputHeaders | "Y" to display HTTP Header Response returned from server. | "N" | {16} | 1 | |
| OutputBody | "Y" to display HTML Body Response returned from server. | "N" | {16} | 1 | |
| ClientTimeout | Rather than "defaults" of 120 seconds. "min" for 10 second minimums during script debugging; "max" for 1000 second maximums during load tests. | min | {17} | 8 | |
| BetweenTriesSecs | The number of seconds to wait between retries. Cannot be a negative number. This can be a decimal number (e.g., 3.2) ranther than a whole integer (such as 3). | 0 | {17} | 8 | |
| ClearCookies | "Y" to clear cookies before each iteration, any other value to not do that. | "N" | {18} | 1 | |
| SiteScope | "Y" to collect SiteScope statistics. | "N" | {19} | 1 | |
| BetweenMonSecs | The number of seconds between SiteScope requests, to avoid overrunning the server under test. | 60 | {19} | long | |
| ProbeSecs | The number of seconds between probe requests, to avoid overrunning the server under test. | 60 | {19} | long | |
| KeepGoing | "Y" ignores errors and continues processing. | "N" | {19} | 1 | |
| ProbeShow | "Y" displays web services Diagnostics statistics in user-defined points on vuser_init, vuser_end, and after each iteration. | "N" | {19} | 1 | |
| ProbeName | IP address or computer name. | localhost | {19} | 256 | |
| ProbeHost | IP address or computer name. | localhost | {19} | 256 | |
| ProbePort | Port used for Dignostics server. | 35000 | {19} | 16 | |
| ProbeUserName | User Name for Diagnostics server. | admin | {19} | 32 | |
| ProbePassword | Password for Diagnostics server. | admin | {19} | 32 | |
| ProcessWithinInit | "Y" processes DriverParms during initialization (vuser_init). Entries in the "TT" (Task Type) column are used to distinguish whether each request is executed during init or during the regular Action section. | "N" | {23} | 1 | |
| ActionLoops | This achieves the same result as setting the Run Logic repetitions for the Action action. | 1 | {24} | 4 | |
| GetURLOnly | "Y" causes LR to make web requests with "MODE=HTTP" (which does not retrieve resources) that works if the script code was recorded in "URL mode" is edited to recognize this. The default, "N", make web requests with "MODE=HTML". | "N" | {25} | 1 | |
| GetExtras | "Y" to get EXTRARES extra resources requested from within javascript. "N" saves time during script debugging. | Y | {26} | 1 | |
| DriverRecStart | The starting row. | 1 | {27} | 4 | |
| DriverRecs | The number of control parameter file records in the DriverParms.csv file. This is automatically updated to the actual record number when value "end" is encountered in the "Seq" column. | 9999 | {27} | 4 | |
| LineupInit | Activate Rendevous point. | "N" | {31} | 1 |
|
| {pURLHostPath} | The front portion of the URL that is common to all requests of the application, the part usually mass replaced with the parameter after a recording. Typically it contains the protocol, Host, and folder, such as: "https://www.yahoo.com/finance/". |
| {pIteration} | |
| {SSMMHH} | Time stamp. |
|
This script displays with each message and output log entry a unique identifier to each request: 060211015432S0GNoneU-1I1.1-1R3 This identifier includes a timestamp. The first part of this is used to name log files:
The second part of this is used to identify processing sequence:
|
|
|
|
|
|
Related Topics:
Performance Testing
NT Perfmon / UNIX rstatd Counters
Mercury LoadRunner
Mercury Virtual Table Server (VTS)
Mercury WinRunner
Rational Robot
Free Training!
Tech Support
| Your first name: Your family name: Your location (city, country): Your Email address: |
Top of Page Thank you! | |||