 | Level: Introductory Allan Tham (thamawh@my.ibm.com), IT Specialist, IBM Foong Yen Lee (leefy@my.ibm.com), IT Specialist, IBM
11 Dec 2007 This second of the four articles in this series helps you get a
jump-start in actually using IBM® Rational® Performance Tester. It
guides you through installing an evaluation copy, creating a simple test, and
running the test against the DayTrader application that is deployed on IBM®
WebSphere® Application Server Community Edition and IBM® DB2®
Express. It is also essential preparation for Part 3, where you will run tests on
increasing sizes of user loads.
About this series
IBM® Rational® Performance Tester is a performance testing tool that
emulates various user loads to mimic the real-life loads. With proper planning
coupled with realistic simulation, this tool uses the current loads to estimate
future loads. For example, a customer's application may potentially serve
a total of 5000 users. With Rational Performance Tester, you can easily emulate
the user loads at 1000, 2000, 3000, 4000, 5000 and beyond to project the right
user growth, so that you can also project server sizing, such as optimal CPU and
memory requirements, more accurately. You can identify and diagnose performance
bottlenecks, whether such problems occur in the network, database, the application
server, or even the user application. The root cause analysis capability further
analyzes application tiers, which may include page components such as Enterprise
Java™Beans (EJBs), servlets, a Java™ Database Connector (JDBC)
API, Web services, and so forth. This functionality enables you to pinpoint the
performance culprit easily and efficiently by analyzing the online or extracted reports.
Here's a quick summary of this series of four articles:
- Part 1 gives you an overview of IBM Rational Performance Tester Version 7.0.
- Part 2 (this part) walks you through the basics of using Rational Performance
Tester by creating, running, and evaluating a simple test.
- Part 3 covers testing as user loads grow (see the next section for more).
- Part 4 is all about reports, because a load test is only as good as the
reports of the results.
The goal of this series is to help you understand the features, topological
considerations, and constraints so that you can create and test Web applications
and analyze the performance reports. With this knowledge and the ease of use of
Rational Performance Tester, load testing a Web application will no longer be a
burdensome chore, and you can include it for each iteration of your software.
Overview of this
article
In the first article of this series, you got an overview of the capabilities of
IBM Rational Performance Tester, which helps automate much of the performance
testing process. This second of four articles helps you get a jump-start in
actually using this testing tool.
Part 2 guides you through installing an evaluation copy, creating a simple test,
and running the test against the DayTrader application that is deployed on
IBM® WebSphere® Application Server Community Edition and IBM®
DB2® Express. It is also essential preparation for Part 3, where you will
run tests on increasing sizes of user loads.
An optional section at the end of this article describes how to deploy the
DayTrader sample application if you want to use it for testing. If you prefer, you
can create the test against the application that you need to test for performance,
instead.
Download an evaluation copy of Rational
Performance Tester V7.0
Download the Rational Performance Tester evaluation copy installer from IBM
developerWorks (three files, called RPT_V7.0_Part_1.zip,
RPT_V7.0_Part_2.zip, and RPT_V7.0_Part_3.zip). The evaluation
license is valid for 30 days from the installation date and allows up to 5
concurrent virtual users. You need to activate Rational Performance Tester with a
purchased license key after the expiration date to continue using it. See
Resources for links to the file downloads and to the IBM
Rational Software Development Platform V7.0 - Desktop Product Activation area,
where you can get the licenses and information about the activation process.
The machine that Rational Performance Tester is installed on is called the
workbench. You will need a minimum of 1GB of memory and 1GB of hard disk space for
this tutorial.
Install Rational Performance Tester
These steps will guide you through the installation:
- Extract these three files into a temporary directory called C:\temp.
- In the disk1 folder, click the launchpad.exe file to start the
installation.
- Select Install IBM Rational Performance Tester (Includes Agent) (see
Figure 1).
Figure 1. Rational installation
screen
- Accept the agreement when you are prompted, and click Next. The IBM
Installation Manager will be installed first. Accept the default location
for it, and click Next.
- Click Install to install the IBM Installation Manager, and click
Finish when the installation is complete.
- The next screen will display the Rational Performance Tester packages to be
installed. Make sure that IBM Rational Performance Tester Version 7.0.0
is selected (Figure 2), and then click Next again.
Figure 2. Install Rational
Performance Tester packages
- Accept the license agreement again to install Rational Performance Tester,
and click Next.
- On the screen that says Select a location for the shared resource
directory, either enter a new location or accept the default location, and
then click Next (Figure 3).
Figure 3. Shared Resources
Directory field
- On the next screen, ensure that Check a new package group is selected,
and either enter a new location for the installation or accept the default
location to install Rational Performance Tester. Click Next. (Figure
4).
Figure 4. Rational Performance
Tester installation location
- Click Next twice until you see the screen that says Select the
Features you want to install. Accept the default, and click Next.
(Figure 5).
Figure 5. Feature screen
Install Rational Agent
Controller
- Keep clicking Next until you see the screen titled Configure the IBM
Rational Agent Controller installation (Figure 6) (IBM®
Rational® Agent Controller is installed with Rational Performance Tester).
- Select Typical installation and click Next.
Figure 6. Install Rational
Agent Controller
- On the Summary Information screen, click Install (Figure 7).
Figure 7. Summary information
screen
- When the installation completes successfully, you will see the screen that
Figure 8 shows. Select IBM Rational Performance Tester and click
Finish. This will start Rational Performance Tester.
Figure 8. Installation
successful notice
Create and run a performance test
To create a performance test to run a against an application, you use Rational
Performance Tester to record a sequence of interactions with the Web-based
application. This sequence is called a test scenario. You need to plan the
test scenarios before you start recording. In this article, The test scenario
example in this article requires the user to log into the DayTrader application,
buy and sell stock, and then log out of the application.
Before recording a performance test, you also need to create the performance test
project that contains the tests. Rational Performance Tester then opens a browser
for you to record the test scenarios and generates the test. You can edit the
generated test to add verification points, data pools, custom code, and other
variables. In this example, you will add a data pool that stores multiple data for
the same value. After the data pool is associated with the test, it will replace
the value in the test with the data from the data pool when executing, thus
simulating different user request to the server.
To run the completed test, you need to create a schedule and a user group for the
test. A schedule contains one or many user groups. Recorded tests are added to the
user groups. Using schedules and user groups enables control over how the tests
run. For example, a test can run sequentially, randomly, or in weighted order; run
at a set interval or repeatedly for a set number of times; run remotely; and
emulate workload. This example uses the response time breakdown option, which is
selected under the schedule, to collect statistics on a captured page element when
the test runs. Response time breakdown shows how much time was spent on each page
that was captured in the test. To collect the breakdown of response times, DCI
monitoring must to be running.
The steps that follow will guide you from creating to running the test and
generating the reports for analysis. To get started:
- First, start IBM WebSphere Application Server Community Edition, which will
start the DayTrader application: Start > All Programs > IBM
WebSphere > Application Server Community Edition > Start the
server.
- Start Rational Performance Tester, and click OK in the default
workspace location to store the test projects (see Figure 9).
Figure 9. Select the default
workspace
1. Create a test project to store the
performance tests
- In the Test Navigator, right-click to display the menu.
- Select New > Performance Test Project (Figure 10). The New
Performance Test Project window will open.
Figure 10. Create a test
project
- Enter the Project Name as
DayTraderProject,
and check Use default location (Figure 11).
- Click Finish to create the project.
Figure 11. Name the test
project
2. Create a new test to record the test
scenario
- After the project is created, the Create New Test from Recording window
will open (Figure 12).
Figure 12. Create the test
window
- Check Create Test from New Recording and select HTTP Recording.
Click Next.
- For Select Location for Test Suite, select the DayTraderProject.
In the Test file name field, enter
DayTraderTest (Figure 13).
- Click Finish to start initializing the recorder.
Figure 13. Name the test
3. Record the test scenario against
DayTrader
- The Rational Performance Tester recorder will open a new browser after it is
initialized.
- In the browser, enter this DayTrader URL to bring up the application (this is
the default location for DayTrader
application):
http://IIC02:8080/daytrader/app
- Record the following test scenario:
- Click the Trading & Portfolios tab.
- Log in, using the default user name and password (Figure 14).
Figure 14. DayTrader login
screen
- When the DayTrader home page is displayed, click the Quotes/Trade link
at the top to open the Quotes page (Figure 15).
Figure 15. Go to Quote/Trade
page
- Click the Buy button in the first row of the Quote table to
purchase 100 shares (Figure 16). The confirmation screen will confirm
your purchase.
Figure 16. Purchase stocks
- Click the Portfolio link at the top to open up the user Portfolio
page.
- Verify that the purchase is reflected in the Portfolio. On the same page,
notice the number of holdings listed.
- Next, click the Sell link in the first row of the Portfolio
table to sell the shares (Figure 17). The confirmation screen will be displayed
to confirm the selling.
Figure 17. Sell stocks
- Click the Portfolio link again to see that the number of holdings
reflects the sale.
- Click Logoff and then close the browser.
The control will return to Rational Performance Tester to process the recording
and display the test content.
4. Create a data pool to replace the user
ID and password value in the test
- In the Test Navigator, right-click to display the menu.
- Select New > Datapool. The New Datapool window will open
(Figure 18).
Figure 18. Create a data pool
- In the Enter or select the parent folder field, enter
DayTraderProject. In the Name field, enter
DayTraderDatapool (Figure 19).
- Click Next.
Figure 19. Data pool details
- For Description, enter Datapool for the login ID, and for Initial
Table Dimension, enter 2 column.
- Click Finish.
- Next, click the Variable1 column, and the Edit Variable window will
open.
- Name the column
LoginID and, for Type, enter
String. Then click OK.
Figure 20. Edit variable 1
- Perform the same step as above for Variable2. Name the column Password and
specify the Type as String.
Figure 21. Edit variable 2
The data pool will contain five different user login IDs, numbered uid:0
through uid:4, as Table 1 shows.
Table 1. User ID and Password values
| User ID | Password |
|---|
| uid:0 | xxx |
|---|
| uid:1 | xxx |
|---|
| uid:2 | xxx |
|---|
| uid:3 | xxx |
|---|
| uid:4 | xxx |
|---|
Tip:
To add a line for the next record, press Enter or
right-click on the last record and select Add Record.
Figure 22. Add data pool
record
Reminder:
Use CRTL-S to save the data pool.
5. Reference DayTraderTest to use
the data pool value
- In the Test Navigator, click DayTraderTest to open the property
page.
- Right-click DayTraderTest and select Add > Datapool.
Figure 23. Add data pool to
test
- When the Import Datapool window opens, select the following:
-
Matching resources: DayTraderDatapool.datapool.
-
Open mode: Shared (per machine)
-
Wrap when the last row is reached: checked
Figure 24. Select data pool
- Click Select to accept the DayTraderDatapool.data pool for the
DayTraderTest. The Test Element Details will be updated with the data
pool information.
Figure 25. Data pool element
details
- To save the changes, use CTRL+S.
6. Associate the user ID (uid) and
password values with the data pool column
- In the Test Navigator, click DayTraderTest to open the property page.
- Expand the Welcome to DayTrader page, and then select
iic02:8080/daytrader/app.
Figure 26. Select the test
page
- Scroll down the Test Element Details screen until you see uid
and passwd in the Data section (Figure 27).
Figure 27. Test value to
associate with the data pool
- Click the uid value (highlighted in purple in Figure 28), so the menu
will display, and select Substitute From > Datapool Variable.
Figure 28. Substitute value
with data pool variable
- The Select datapool column window will open. Select
Column:LoginID, and then click the Use Column button at the bottom
(Figure 29).
Figure 29. Use data pool value
The uid value will be highlighted in green to indicate the association
(Figure 30).
Figure 30. Associated uid
value
- Repeating the steps before and after Figure 25 to
associate the password value with the password column from the data pool. The
password will be highlighted in green after the association, as Figure 31
shows.
Figure 31. Associated password
value
- After completing the association, click the Welcome to DayTrader page
again. Note that the Test Data table now contains the association (Figure
32).
Figure 32. Verify association
- To save the changes, use CTRL+S.
7. Create performance schedules
- In the Test Navigator, right-click DayTraderProject to display
the menu, and then select New > Performance Schedule (Figure 33).
Figure 33. Create performance
schedule
- The Performance Schedule window will open (Figure 34). Enter
DayTraderSchedule as the name for the schedule.
Figure 34. Schedule details
In the Performance Schedule property window (Figure 35), under
Schedule Contents, notice the DayTraderSchedule with one user
group. In the Schedule Element Details, the General tab
displays the Number of users as 5 by default. This is the maximum
number of virtual users that you can run on the Rational Performance Tester
evaluation copy.
Figure 35. Performance
schedule property window
8. Configure the response time breakdown
in the schedule for data collection
- In Schedule Element Details, click on the >>
(double greater-than signs) to show more tabs.
- Click the Response Time Breakdown tab (Figure 36).
- Select Enable collection of response time data (Figure 37).
- Select DayTraderTest to perform the collection.
- Under Options, select High as the Detail level.
- The select Only sample information from a subset of users.
- Select Fixed number of users, and
enter
2 for per User Group.
Figure 36. Response Time
Breakdown tab
Figure 37. Response time
breakdown settings
- Be sure to save the changes (CTRL+S).
The default, User Group 1, will be used to add the test. The default user
group size is 100% running on the local computer (see Figure 38). In the second
section of this article (Part 3), there will be steps to add more user groups as
the user load test increases.
Figure 38. Default user group
9. Add DayTraderTest to DayTraderSchedule
- In the Performance Schedule property window, right-click on User
Group 1, and select Add > Test (Figure 39).
Figure 39. Add the test to the
schedule
- In the Select Performance Tests window, expand the
DayTraderProject and select DayTraderTest (Figure 40).
- Click OK.
Figure 40. Select
DayTraderTest
The test is added to the schedule under User Group 1 (Figure 41).
Figure 41. DayTraderTest added
to schedule
- Use CTRL+S again to save the changes.
10. Run the DayTrader test and review the
reports
- First, start DCI (data-conversion interface) monitoring (Figure 42).
In Windows: IBM Software Delivery Platform > IBM Rational Data
Collection Infrastructure > Start Monitoring.
Figure 42. Start DCI
- In the Test Navigator, right-click DayTraderSchedule to display
the menu.
- Select Run As > Performance Schedule (Figure 43).
Figure 43. Run the performance
test
Rational Performance Tester will launch the schedule, collect the data, and
display the results in reports when the collection is finished.
- Scroll through the different tabs to view the reports.
Figure 44. Completed
performance report
When you have the completed performance report, you can export a copy in HTML,
XML, or CVS formats for further analysis, printing, display in the browser, or
simply to share the report by e-mailing it to someone. Follow these steps to
export the report to HTML:
- In the Performance Test Runs view, right-click the report that you want
to export.
- Select Export To HTML from the menu (Figure 45).
Figure 45. Export the report
to an HTML file
Note:
If you cannot see the report, right-click
DayTraderSchedule and select Display Report from the menu (Figure
46).
Figure 46. Display the report
- Provide the location and file name for the report, and then
click Finish (Figure 47).
Figure 47. Specify the
location and the HTML file name for the report
- Open the exported report and review it on your Web browser (Figure 48).
Figure 48. Performance report
in HTML format
About Part 3. How to
test various sizes of user loads
Now that you understand the basics, you're ready to proceed to Part 3 (see the
link in Resources) to run performance tests on user loads
of varying sizes.
Optional: Deploy the
DayTrader sample application
- Download IBM WebSphere Application Server Community Edition V1.1.0.2
(see the link in Resources), and install it on the same machine where Rational
Performance Tester is installed.
- Download IBM DB2 Express-C 9 (see Resources), and install it on the
same machine where Rational Performance Tester is installed.
- Download the DayTrader.zip file from the Downloads section, and unzip
it to your C:\ directory.
- Next, set up the database:
- In a DB2 command window, create a database called
tradedb:
Command:
db2 create db tradedb
- Issue a connect to tradedb using db2admin:
Command:
db2 connect to tradedb user <db2admin> using
<password>
- Load the database schema for tradedb:
Command:
db2 –tvf C:\daytrader\modules\db2\sql\Table.ddl
Figure 49. Create and
configure tradedb
Deploy the DayTrader application into WebSphere Application Server by following
these steps:
- Edit the C:\daytrader\plans\dayTrader-db2-9.1-XA-plan.xml file:
- Modify the User, Password, DatabaseName and
ServerName properties for TradeDataSource.
- Look for these values in (shown in {brackets] in Listing 1), and change
then to the correct information:
- {db2admin}
- {db2admin_passwd}
- {iic02.iicmy.ibm.com}
- {tradedb}
Listing 1. Code in the XML file
<name>jdbc/TradeDataSource</name>
<config-property-setting
name="User">{db2admin}</config-property-setting>
<config-property-setting
name="Password">{db2admin_passwd}</config-property-setting>
<config-property-setting
name="PortNumber">50000</config-property-setting>
<config-property-setting
name="ServerName">{iic02.iicmy.ibm.com}</config-
property-setting> <config-property-setting
name="DatabaseName">{tradedb}</config-property-setting>
<config-property-setting
name="DriverType">4</config-property-setting>
|
- Save the changes to the dayTrader-db2-9.1-XA-plan.xml file.
- Start WebSphere Application Server Community Edition by clicking
Start > IBM WebSphere > Application Server community Edition
> Start the server.
- Open the Windows command line, and change the directory to
%WASCE_HOME%\bin.
- Use this command to deploy the daytrader.ear file:
deploy.bat deploy
C:\daytrader\modules\ear\target\daytrader-ear-1.1.1.ear c:\daytrader\plans\
dayTrader-db2-9.1-XA-plan.xml
- When prompted for the user name and password during deployment, enter system
for username and manager as the password.
Figure 50. Deploy the
daytrader.ear file
- When deployment completes, restart WebSphere:
- Start > IBM WebSphere > Application Server community Edition
> Stop the server
- Start > IBM WebSphere > Application Server community Edition
> Start the server
- Configure DayTrader before starting to use it:
- In a Web browser, open this URL:
http://iic02:8080/daytrader/
- Click the Configuration tab, and then click (Re)-populate
DayTraderDatabase.
Figure 51. Populate the
DayTrader database
- A new browser will open to perform the population action. Wait until it
completes before closing the browser.
- Notice the user IDs populated. You will use this to log in to the DayTrader
application. The password for all user IDs password
is
xxx (Figure 52).
Figure 52. Deploy data to the
tradedb database
Download | Description | Name | Size | Download method |
|---|
| DayTrader sample application | daytrader.zip | 1799 KB | HTTP |
|---|
Resources Learn
- Visit the
IBM
Rational Performance Tester InfoCenter
for an index to Help topics.
- Enroll in
RT523: Essentials of IBM Rational Performance Tester V7.0.
This introductory course focuses on getting started with Rational Performance
Tester and practical application of the tool to resolve common performance testing
challenges. Testers can build, enhance, and run scripts in a full-function Java
Integrated Development Environment (IDE) that integrates with other IBM Rational
Software Delivery Platform products. This live instructor-led course takes place
online, with hands-on labs and real-time interactions.
- Visit the
Performance Tester area on developerWorks Rational
for technical resources and best practices information on this product.
- Subscribe to the
developerWorks Rational zone newsletter.
Keep up with developerWorks Rational content. Every other week, you'll
receive updates on the latest technical resources and best practices for the
Rational Software Delivery Platform.
- Browse the
technology bookstore
for books on these and other technical topics.
Get products and technologies
Discuss
About the authors  | 
|  | Allan W. Tham provides presale technical support to IBM Business Partners for IBM DB2 data warehouse, information management, and Rational software. He is also an extended member of the IBM Innovation Center, helping ISVs migrate various databases to IBM DB2 and perform load tests using the Rational testing suite. Allan earned an Honor Specialized Computer Science degree from York University, Canada, and he is a certified DB2 Content Manager designer and DB2 Universal Database administrator. Before joining IBM, he worked in a nationwide government procurement system for end users, where he was an Oracle database administrator for three years. |
 | |  | As a technical consultant at the IBM Innovation Center for Business Partners in Kuala Lumpur, Malaysia, Foong Yen Lee helps ISVs and other business partners integrate IBM technologies and products. Foong Yen provides in-depth technical guidance regarding porting, product validation, testing, performance tuning, technical education, and proof of concept. |
Rate this page
|  |