Spirent Avalanche 5.46 February 29, 2024
Use the LOOP action to execute a set of URLs multiple times, eliminating the need to cut and paste the same URLs repeatedly into your Action list. You can control the number of times you execute a loop by elapsed time (TIME) or by counting (COUNT or GLOBALCOUNT) the number of times the loop runs.
NOTE: If you place a THINK action within the loop, it will override the loop TIME value. |
NOTES:
|
You can also use the ASSIGN and APPLY actions to configure loops by assigning a variable name and then applying it to the COUNT value. A forms database can provide the variable value.
The Loop report, available in the summary.csv URL section of results, shows the minimum, maximum, and average response times. For more information, see Client URL Results.
TIP: To measure the amount of time in milliseconds that it takes to execute a list of URLS, use the TIMER action. |
Syntax
LOOP loop_name START COUNT=number of loops (or GLOBALCOUNT=number of loops)
list of urls
LOOP loop_name STOP
loop_name—an alphanumeric name that identifies the loop.
number of loops—the number of times you want to execute the URLS contained in the loop. When the count is reached, the Action list jumps to the LOOP STOP action.
list of URLs—the set of URLS that you want to execute.
Example
The following loop executes a set of six URLs three times.
LOOP my_loop1 START COUNT=3
1 GET http://www.somewebsite.com/
2 GET http://www.somewebsite.com/images/about.gif
1 GET http://www.somewebsite2.com/
2 GET http://www.somewebsite.com/images/notes.gif
1 GET http://www.somewebsite3.com/
2 GET http://www.somewebsite3.com/images/welcome.gif
LOOP my_loop1 STOP
Syntax
LOOP loop_name START TIME=amount of time (milliseconds)
list of urls
LOOP loop_name STOP
loop name—an alphanumeric name that identifies the loop.
amount of time—time in milliseconds that the loop runs. If the time has expired, the Action list jumps to the LOOP STOP action.
list of URLs—the set of URLS that you want to execute.
Example
The following loop repeatedly executes a set of six URLs for 200 milliseconds.
LOOP loopabc START TIME=200
1 GET http://www.somewebsite.com/
2 GET http://www.somewebsite.com/images/about.gif
1 GET http://www.somewebsite2.com/
2 GET http://www.somewebsite2.com/images/notes.gif
1 GET http://www.somewebsite3.com/
2 GET http://www.somewebsite3.com/images/welcome.gif
LOOP loopabc STOP
Syntax
LOOP loop_name START COUNT=<APPLY variable>
list of URLs
LOOP loop_name STOP
loop name—an alphanumeric name that identifies the loop.
variable—a variable that sets the count. The variable has been assigned a value previously.
list of URLs—the set of URLS that you want to execute.
For more information about ASSIGN, APPLY and Forms Databases, see HTTP Assign Variables, HTTP Apply, and Using Forms Databases with Action Lists.
Example one variable
The following loop uses a variable to set the count to five.
ASSIGN VARIABLE <loopvariable "5">
LOOP loopxyz START COUNT=<APPLY loopvariable>
1 GET http://www.somewebsite.com/
2 GET http://www.somewebsite.com/images/about.gif
1 GET http://www.somewebsite2.com/
2 GET http://www.somewebsite2.com/images/notes.gif
1 GET http://www.somewebsite3.com/
2 GET http://www.somewebsite3.com/images/welcome.gif
LOOP loopxyz STOP
Example nested loops, variable, forms database
The following example uses a nested loop that repeats the inner loop a number of times. Each time through the loop it executes the URLs.
When the inner loop exits, the myvar1 and inner_loop_counter variables are assigned new values from the Numbers.$1 and Numbers.$2 form databases respectively.
The outer loop repeats the assignment and inner loop sequence 10 times before exiting.
As an example, assume the inner loop counter is 10. The total number of requested URLs would then be equal to the outer loop (10) * inner loop (10) * number of URLs (6), or 600 requests.
ASSIGN VARIABLE <outer_loop_counter "10">
LOOP loop_outer START COUNT=<APPLY outer_loop_counter>
ASSIGN VARIABLE <myvar1 Numbers.$1>
ASSIGN VARIABLE <inner_loop_counter Numbers.$2>
LOOP loop_inner START COUNT =<APPLY inner_loop_counter>
1 GET http://www.somewebsite.com/index.html?test=<apply myvar1>
2 GET http://www.somewebsite.com/pages/about.html?test=<apply myvar1>
1 GET http://www.somewebsite2.com/index.html?test=<apply myvar1>
2 GET http://www.somewebsite2.com/pages/notes.html?test=<apply myvar1>
1 GET http://www.somewebsite3.com/index.html?test=<apply myvar1>
2 GET http://www.somewebsite3.com/pages/welcome.html?test=<apply myvar1>
LOOP loop_inner STOP
LOOP loop_outer STOP
© 2024 Spirent Communications, Inc. All Rights Reserved.