DeclareOnce
epURL
=
"http://www.YourWeb.com"
; URL under test
DeclareOnce
epHTTPCommand
=
"GET"
; HTTP command to send
DeclareOnce
epDelay
=
0
; Interval between send operations in msecs
DeclareOnce
epNoConnections
=
6
; Number of connections
Declare
Status
,
i
,
Time
,
FileName
,
UrlName
Declare
LUT_Results
Declare
ID
[
epNoConnections
]
; Establish HTTP Connections
For
i
=
0
to
epNoConnections
-
1
HTTP_NewClient
ID
[
i
],
epURL
Next
; Send a command from each connection
For
i
=
0
to
epNoConnections
-
1
HTTP_API
Status
,
`
SendHttpRequest
`
,
ID
[
i
],
epHTTPCommand
if
epDelay
>
0
Then
Delay
epDelay
Next
; Create Lookup Table Coronys object (LUT)
LT_Create
LUT_Results
,
0
,
1
; Set Headers to the 1st row
LT_SetValues
Status
,
LUT_Results
,
0
,
0
,
"Conn.ID,Resp.Time"
; Get response times per channel
For
i
=
1
to
epNoConnections
Do
; Wait until all requests responded
HTTP_API
Time
,
`
GetHttpRequestTime
`
,
ID
[
i
-
1
]
Delay
200
Until
(
Time
>=
0
)
||
(
Time
==
(-
2
))
; Save response time to the LUT - row per connection
LT_SetValues
Status
,
LUT_Results
,
i
,
0
,
i
$
","
$
Time
; Show the progress window
DisplayInfo
"Loop = "
$
i
$
" of "
$
epNoConnections
Next
HideInfo
; remove the progress window
; Close HTTP connections
For
i
=
0
to
epNoConnections
-
1
HTTP_Delete
ID
[
i
]
Next
; Generate file name for Results
StrInBetween
UrlName
,
epURL
,
"."
,
"."
; Extract WEB name
FileName
=
GT_TreeRelativePath
$
"Temp\"
$
UrlName
$
".html"
; Generate Respose Time Dispersion chart to the report
LT_ReportAsHTML
Status
,
LUT_Results
,
FileName
,
"$<h1>HTTP Load Report</h1><br><h2>"
$
epURL
$
"</h2>"
,
""
Chart_Command
Status
,
"
ChartFromLUT
"
,
LUT_Results
,
"Response Time"
,
"Conn.ID"
,
"Resp.Time"
,
"Bar"
; Clean LUT by re-creating the object
LT_Delete
LUT_Results
LT_Create
LUT_Results
,
0
,
1
; Add a chart to the report and show in your default browser
LT_ReportAsHTML
Status
,
LUT_Results
,
FileName
,
""
,
""
,
1
,
""
,
1
,
1
; Close LUT object
LT_Delete
LUT_Results
End
;@DBG:NEST - 1 - @DBG:IsInJob; Exit Current Test