Rational Insight is an enterprise reporting solution that is built on the IBM® Cognos® Business Intelligence (BI) server. When Rational Performance Tester simulates user activity and generates load against the Rational Insight report server, the Hourglass page, which indicates server activity, can cause problems for the following reasons:
- In Rational Performance Tester, the record and playback mechanism that generates load against the server and the simple recorded scripts have insufficient loop control to handle the Hourglass page.
- The behavior of the Rational Insight report server differs depending on the server workload, so Rational Performance Tester needs special scripts so handle the Hourglass page.
- In Rational Performance Tester, the Content VPs mechanism for verifying response content statically cannot verify the dynamic content of the Hourglass page.
To handle the Hourglass page and process its dynamic content when you test the performance of Rational Insight, use the scripts and custom code in this article.
The Hourglass page in Rational Insight
The Rational Insight report server is a typical, three-layer B/S application with which users can generate reports through a Web browser.
When the server submits a new request from a user to run a report, an Hourglass page is returned (Figure 1). When you record with Rational Performance Tester, there is usually only one active user in the system, so the Rational Insight server is not busy and the Hourglass page is not recorded. However, when you play back the Rational Performance Tester script to simulate multiple users, considerable workload is generated for the Rational Insight server, which might respond to a user request with an Hourglass page. This activity causes a Rational Performance Tester script failure because there is not enough code to handle this condition.
Figure 1.Hourglass progress page
Two requests can generate an Hourglass page when the Rational Insight server is busy. One request is for the Prompt page; when the status for this request is complete, the Hourglass page is in the Prompting state. The second request is for the Report generation page; when the status for this request is complete, the Hourglass page is in the Complete state (Figure 2).
Figure 2. State transfer in Prompt page and Report Generation page
Handle the Hourglass page with Rational Performance Tester scripts and custom code
To enable the script to handle all conditions in which the Hourglass page might be displayed, you can use the returned status from the Rational Insight server to control the Rational Performance Tester script loops (Figure 3), regardless of how many loops the Hourglass page iterates.
Figure 3. Control flow of Hourglass page handling
A typical Rational Performance Tester script looks like the script in Figure 4. The custom code GetFirstStatus returns the first status from Rational Insight server. The returned status is used in an "If" clause to control whether to enter the loop. The infinite loop in the Rational Performance Tester script iterates the Hourglass page, and the custom code PromptLoopControl accesses the server status and uses the returned status to control whether to exit the loop.
Figure 4. Sample Rational Performance Tester scripts for handling the Hourglass page
Because the status information that is returned from the server response is critical to control the Rational Performance Tester script loops, you must use the Rational Performance Tester custom code to extract status and other context information. Sample custom code is shown in Listing 1, where a technique called regular expression matching is adopted.
Listing 1. Custom code to extract status information from server response
Matcher matcher = Pattern.compile(".*"status": "(.*)",
"conversation": "(.*)", "tracking":
"(.*)", "secondaryRequests".*"parameters":
"(.*)"",Pattern.DOTALL).matcher(args[0]);
if (matcher.lookingAt()) {
status = matcher.group(1);
}
|
The Rational Performance Tester API also provides a loop control function. In this case, the custom code checks the status, and if the status equals complete, it exits the loop by calling getLoopControl.breakLoop().
Listing 2. Custom code for loop control
private void loopControl(ITestExecutionServices tes, boolean error,
String status) {
String trans_result = error ? "abort" : "done";
IDataArea userDataArea = tes.findDataArea(IDataArea.VIRTUALUSER);
if (status.equals("error")) {
//The attempted vp increased by 1
vpNumAttempt.increment();
//The failed vp increased by 1
vpNumFailed.increment();
tes.getTestLogManager().reportMessage(
String.valueOf("VPFailed: " + vpNumFailed.value()));
tes.getLoopControl().breakLoop();
} else if (status.equals("complete")) {
//The attempted vp increased by 1
vpNumAttempt.increment();
//The Passed vp increased by 1
vpNumPass.increment();
tes.getLoopControl().breakLoop();
}
}
|
Rational Performance Tester verification points
To verify the expected behavior from specific page responses, you can use the Rational Performance Tester verification points (VPs): Page Title VPs, Response code VPs, Response size VPs, and Content VPs.
Page title VPs: Verify the expected page title of the primary request for a page. If the returned title is unexpected, the failed verification point counter increases by 1 and can be indicated in the Rational Performance Tester test reports.
Response code VPs: Verify that the response code matches an expected value. If returned response code is not 200, 201, 202, 204, 206, 301, 302, or 304, the failed verification point counter increases by 1 and can be indicated in the Rational Performance Tester test reports.
Response size VPs: Verify that the number of bytes returned in a response is what you expected. If the byte count does not match, the failed verification point counter increases by 1 and can be indicated in the Rational Performance Tester test reports. You can specify an exact response size or verify that the byte count is within a range.
Content VPs: Verify that the response contains an expected string. Verification can fail for two reasons: if at least one of checked string is found and if none of the checked strings are found.
After the test scheduler in Rational Performance Tester runs, you can view the results of the related Page Element VPs in the Page Element Summary (Figure 5). The Total Page Element VPs Passed [for Run] shows how many verification points passed. The Percent Page Element VPs Passed [for Run] shows the percentage of VPs. You can use these indicators to assess the state of the response content of key pages. If some verification points failed, you can check the test log to find the error message and pinpoint the root cause of the errors.
Figure 5. Verification points report
Customize verification points for the Hourglass page
As the status transition flow (Figure 2) shows, the key verification point for the Hourglass page is the hourglass status value. If the hourglass status is complete, the Hourglass page has run successfully and the number of passed VPs increases. If something is wrong with server, the page response returns content with an error message, and the number of failed VPs increases. However, when the server is busy and the hourglass status is Working or Still Working, no verification points are measured.
The four types of verification points will not verify the dynamic response content for the Hourglass page. To verify that content, use custom code to create verification points that can filter and analyze the hourglass status from the dynamic content.
The typical processing for hourglass verification points is as follows:
- The response content is processed and the status value is filtered by using a Java™ regular expression. The status value will be either completed, working, stillWorking, or error.
- The verification point counter objects (vpNumPassed, vpNumFailed, and vpNumAttempted) are consumed by Rational Performance Tester to be displayed in reports.
- The verification point counters are increased according to the status value. If the status equals
completed, the verification points passed (vpNumPassed) increase by one. If the status equalserror, the verification points failed (vpNumFailed) increase by one.
Listing 3. Sample code for custom verification points
String pageTitle = args[1].toString();
if (rootStat != null) {
//Initialize and construct VP objects.
String[] pathPass = { "Custom", "Verification Points",
"All Custom VPs", "Pass", pageTitle + "_VPass" };
String[] pathFail = { "Custom", "Verification Points",
"All Custom VPs", "Fail", pageTitle + "_VPFailed" };
String[] pathAttempt = { "Custom", "Verification Points",
"All Custom VPs", "Attempt", pageTitle + "_VPAttempt" };
vpNumAttempt = rootStat.getStatic(pathAttempt);
vpNumPass = rootStat.getStatic(pathPass);
vpNumFailed = rootStat.getStatic(pathFail);
}
Matcher matcher = Pattern.compile(".*"status": "(.*)",
"conversation": "(.*)", "tracking":
"(.*)", "secondaryRequests".*"parameters":
"(.*)"",Pattern.DOTALL).matcher(args[0]);
if (matcher.lookingAt()) {
status = matcher.group(1);
}
if (status.equals("error")) {
//The attempted vp increased by 1
vpNumAttempt.increment();
//The failed vp increased by 1
vpNumFailed.increment();
tes.getTestLogManager().reportMessage(
String.valueOf("VPFailed: " + vpNumFailed.value()));
} else if (status.equals("complete")) {
//The attempted vp increased by 1
vpNumAttempt.increment();
//The Passed vp increased by 1
vpNumPass.increment();
}
|
With this custom code, when Rational Performance Tester runs a test, the custom verification point counters are recorded. However, the default Rational Performance Tester template does not show the custom counters. To see the custom verification points in a table or a trend line chart in a Rational Performance Tester report, drag the counters to the responding panels of the reports, as shown in Figure 6.
Figure 6. Summary of custom verification points
When you test the performance of the Rational Insight report server or other Cognos- and Rational Insight-based solutions, you can use the practices in this article to troubleshoot issues that you might encounter with the Hourglass page. You can use custom code in Rational Performance Tester to implement complex loop control, run simulations, and implement verification points.
Learn
-
Browse the Rational Performance Tester developerWorks page for links to technical articles and many related resources.
-
Explore the Rational Performance Tester Information Center.
-
Join the Rational Performance Tester forum to ask questions and participate in discussions.
-
Get the Rational Performance Tester free trial download.
-
Browse the developerWorks Rational Insight page for links to technical articles and many related resources.
-
Explore the Rational Insight Information Center.
-
Join the Rational Insight forum to ask questions and participate in discussions.
-
Learn about other applications in the IBM Rational Software Delivery Platform, including collaboration tools for parallel development and geographically dispersed teams, plus specialized software for architecture management, asset management, change and release management, integrated requirements management, process and portfolio management, and quality management. You can find product manuals, installation guides, and other documentation in the IBM Rational Online Documentation Center.
-
Visit the Rational software area on developerWorks for technical resources and best practices for Rational Software Delivery Platform products.
-
Explore Rational computer-based, Web-based, and instructor-led online courses. Hone your skills and learn more about Rational tools with these courses, which range from introductory to advanced. The courses on this catalog are available for purchase through computer-based training or Web-based training. Some of the "Getting Started" courses are available free of charge.
-
Subscribe to the IBM developerWorks newsletter, a weekly update on the best of developerWorks tutorials, articles, downloads, community activities, webcasts and events.
-
Browse the technology bookstore for books on these and other technical topics.
Get products and technologies
-
Download trial versions of other IBM Rational software.
-
Download IBM product evaluation versions and get your hands on application development tools and middleware products from DB2®, Lotus®, Tivoli®, and WebSphere®.
Discuss
-
Check out developerWorks blogs and get involved in the developerWorks community.






