Ben Smith and Laurie Williams [Contact Authors] |
|
Performance Testing is a process by which software is put under a certain demand load and measured for its response times, memory usage and other performance-related metrics. Applications which are used in parallel by more than one user can experience varying loads at different times of demand. By looking at which of a given set of performances an application gives, we can determine where its performance weaknesses are and optimize it for efficiency to ensure that it does not break or slow to a hault when under high demand. Rational Performance Tester is an integrated design and development environment developed by IBM, built on the Eclipse IDE. The goal of Rational Performance Tester is to provide an integrated environment for Java developers to gather performance metrics and optimize applications for memory and execution time. The following tutorial will demonstrate gathering performance metrics with the web application iTrust and Rational Performance Tester 7.0.0.2. By recording specific use cases with Rational Performance Tester, we can create a performance test or a systematic, repeatable series of user requests that would typically occur after deployment. After we have one or more performance tests, we can specify a performance schedule which will specify the mix of types of performance tests, the frequency, delay between requests, etc. Running our performance schedule will generate a performance report, which we can use to analyze the recordings of performance-related metrics (such as response time or memory usage) to determine the bottlenecks in our system and do our best to erradicate them. |
IMPORTANT: This tutorial assumes you already have the following set up on your computer:
NOTE: Since the memory requirements of this tutorial are quite high, the VCL image Rational Performance Tester saved which is completely prepared to execute the tutorial.
Accessing the lab requires Remote Desktop Connection on a Windows machine. To connect to the image, execute the following steps:
|
|
To prepare for execution of the steps in the tutorial, you will need to ensure that iTrust is running and configured properly.
Double-click
|
|
To test iTrust's response times under a specific user load, we will need to create an HTTP test from recording. This is achieved by the following procedure:
|
|
When you close the browser window, the recorder control will generate your performance test and save it to the test file you specified above. You have now simulated a healthcare professional checking for epidemics in his or her area. The performance test contents will be displayed within Rational Performance Tester as shown in Figure 4.1.
The titles for each page recorded as you simulated a users path through the iTrust system are useful, but are too generic for understanding the differences in performance with a given use case. Each Test Element Node in the contents represents an HTTP request/response pair. To determine and set a better label for each node, you will want to see the HTTP response that was recorded for each element. Follow these steps:
Now you will need to create a datapool to collect response statistics over time. Execute the following steps:
|
|
Your performance test has been created and appropriately annotated. But to see how iTrust responds to multiple users, we must create a performance schedule with this test. This is achieved with the following procedure:
|
|
Now you have created a performance schedule with multiple healthcare professionals checking for an epidemic. We will now execute it to gather our performance statistics. To do this, right-click on
Your performance report will now appear with the status of collecting the test data in the
Export your results to HTML by completing the following steps:
page element details section) can help us discover bottlenecks in our system.
Which page exhibits the highest response time? What iTrust Objects are involved in a request of that type? Why could they be slow? What could be done about it?
|
|
Accessing a web application is not the only form of performance testing. We can gather statistics on Memory Usage and Execution Time for any Java program using RPT's Profiling tools. Since iTrust has a thorough test suite, we will use jUnit to gather execution time statistics for the iTrust bean validators. To profile these jUnit tests, execute the following steps:
Profiling Monitor tab under DefaultMonitor. Expand every subnode in the tree
until you end up with something looking like Figure 7.5.
Execution Time Analysis to see your results. You should get something that looks
like Figure 7.6. You may want to click the % sign to look at your statistics
relative to each other. You can also sort the list by any of the columns by clicking them.
junit.framework package should not be included in your analysis of performance
bottlenecks, because it will not be included when the application is executed in deployment. But why is
edu.ncsu.csc.itrust.validate so high?
Expand the edu.ncsu.csc.itrust.validate package's node and continue to expand the node with the highest Base Time percentage. You will reach the second checkFormat method as shown in Figure 7.7. Why does this method consume so much execution time? Right click on it and select Open Source to analyze it at the sourcecode level.
|
You now know how to create performance tests and schedules and how to gather performance results using Rational Performance Tester. For this exercise:
|