

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi,
I am stuck at a strange problem. There is a batch job for which we need to monitor the response time. This batch job is running at the backend and we have a URL to fetch the job details.
The URL is something like http://application.domain.com/contextpath/servlet?jobid=XXX
Now when I hit the URL, and if the job is running I get response as 'Job XXX: Running'
After multiple hits on the same URL, I can either get Job Status = 0 or 1 depending on pass or failed status.
How can I loop the multiple hits and fetch the response time for whole batch execution using LR. Also the pass or fail status of the transaction will depend upon the job status returned.
Any help will be highly appreciated.
Thanks in advance,
Regards.
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello!
You can put the request into a while loop and repeat it until the result as you expect. If you enclose the following structure into transaction you will get the timing:
// register the command to analyse the server response
web_reg_find("Text=<your string>", "SaveCount=Wait_count", LAST );
// the request
web_url("saw.dll_6",
. . .
LAST);
// verify the result: wait or no wait
lr_output_message("There is a wait message %s", lr_eval_string("{Wait_count}"));
// loop to iterate the request until the final result is created
while (strcmp(lr_eval_string("{Wait_count}"), "0") != 0)
{
// wait 10.000 miliseconds
sleep (10000);
// verify the result: wait or no wait
web_reg_find("Text=<your string>", "SaveCount=Wait_count", LAST );
// repeat the request
web_url("saw.dll_6",
. . .
LAST);
// verify the result: wait or no wait
lr_output_message("There is a wait message %s", lr_eval_string("{Wait_count}"));
}
You may vary the number in the sleep() command.
Regards
Thomas

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Using a monitoring solution like HP SiteScope, you should be able to check that URL at regular intervals, or write a script to test the return value of that URL request, and get a reasonably accurate measurement of the batch time.
Shane Evans

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello!
You can put the request into a while loop and repeat it until the result as you expect. If you enclose the following structure into transaction you will get the timing:
// register the command to analyse the server response
web_reg_find("Text=<your string>", "SaveCount=Wait_count", LAST );
// the request
web_url("saw.dll_6",
. . .
LAST);
// verify the result: wait or no wait
lr_output_message("There is a wait message %s", lr_eval_string("{Wait_count}"));
// loop to iterate the request until the final result is created
while (strcmp(lr_eval_string("{Wait_count}"), "0") != 0)
{
// wait 10.000 miliseconds
sleep (10000);
// verify the result: wait or no wait
web_reg_find("Text=<your string>", "SaveCount=Wait_count", LAST );
// repeat the request
web_url("saw.dll_6",
. . .
LAST);
// verify the result: wait or no wait
lr_output_message("There is a wait message %s", lr_eval_string("{Wait_count}"));
}
You may vary the number in the sleep() command.
Regards
Thomas


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Thanks Thomas!!! This should do the trick.
Regards,
Vaibhav