-
Notifications
You must be signed in to change notification settings - Fork 8
/
getRate.script
28 lines (22 loc) · 916 Bytes
/
getRate.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# This SLAMD script performs a basic HTTP GetRate
# Make the HTTP data types available for use.
use com.sun.slamd.scripting.http.HTTPClientVariable;
use com.sun.slamd.scripting.http.HTTPRequestVariable;
use com.sun.slamd.scripting.http.HTTPResponseVariable;
# Define the variables we will use.
variable string url;
variable int statusCode;
variable HTTPClient httpClient;
variable HTTPRequest request;
variable HTTPResponse response;
url.assign(script.getScriptArgument("url", "http://slamd.example.com:8080/slamd/"));
httpClient.setFollowRedirects(true);
httpClient.setBlindTrust(true);
httpClient.enableStatistics();
request.assign( url );
# Loop forever. This will be automatically stopped when the stop time has
# arrived or the job has been run for the maximum allowed duration.
while script.shouldNotStop()
begin
response = httpClient.sendRequest(request);
end;