Asyou might have already noticed, last week TopCoder posted a component design competition that involves Rational Performance Tester (RPT) -- RPT Logging Adapter -- and, in fact, a series of more RPT component competitions are launching today. Are you ready?
1. Overview
Rational Performance Tester is a load and performance testing tool for web-based applications; it helps development teams validate the scalability and reliability of their on-going web applications before deployment and production. RPT allows you to capture your interactions to test your web-based applications, recording them and examining them later to measure your application's performance. You can also use RPT to further identify the root causes of poor performance issues from the hardware- or software-component level through advanced resource monitoring and response-time tracking.
Installation
RPT is built on top of the Eclipse framework, so if you already have Eclipse installed in your system, you may choose to install RPT as an extension (options are available in the installation wizard). A fresh installation will have a dedicated copy of Eclipse installed as well.
2. Getting Started with Rational Performance Tester
In RPT, performance testing has five stages: test creation, test editing, workload emulation with schedules, schedule execution, and evaluation of results.
Case Study: Struts MailReader Demo Application
Now let's go through a step-by-step case study that covers the abovementioned stages. This demonstration is based on the MailReader Demo Application shipped with Apache Struts 1.3.8, a simple application that maintains email information of registered users. In this case study, we will test performance of both viewing pages and editing the email information.
Test Plan
Let's assume a scenario like this: There are two groups of users, one group who just views the web pages (viewing group, 70% of all users) while the other group edits their email information (editing group, 30% of all users). In the scenario, each group will perform their operations 20 times: the viewing group performs 5 operations per minute, while the editing group performs 4 operations per minute.Create a "Performance Test Project".
Launch RPT, click File > New > Performance Test Project, enter project name "RPTTest1" and select the location, then click Finish to create the project.
Fig 2.1 Create project
Fig 2.2 Enter project name and location
Record Tests
Click File > New > Test from Recording, choose HTTP Recording in the dialog, click Next, enter the test name "View", and click Finish.
Fig 2.3 Start an HTTP Recording
Fig 2.4 Enter Test Name
Now your browser will be launched, through which you'll start to interact with your application. Enter the address of your deployed MailReader Demo Application to begin. Note that if the application is deployed on the same machine as RPT, make sure not to use "localhost" or "127.0.0.1" as the host name -- by default, connections to local addresses will not pass through the RPT proxy, so you should simply bind an IP address with your application container.
Fig 2.5 Initial Web Page of HTTP Recording
Log onto the application with username "test" and password "test", then logout and exit the browser.
Fig 2.6 Homepage of MailReader Demo Application
Now your will see a test named "View" in Test Navigator view.
Fig 2.7 Created Tests
We also need to create a test named "Edit," using similar steps, whose testing interactions will include logging on, editing email addresses and logging out.Execute Tests and Make Changes
Now you can execute the created tests by right-clicking them and selecting Run As > Performance Test to see if the tests behave as expected. You can make changes to the tests as necessary.Create Performance Schedule
Right-click the project, and then click New > Performance Schedule, enter the schedule name "Schedule" in the dialog, and click Finish.
Fig 2.8 Create Performance Schedule
A new schedule is displayed with one user group. Since we need two user groups, right-click the schedule, then click Add > User Group to add another group.
Fig 2.9 Newly Created Schedule
Change the Group Size of "User Group 1" to 70%, right-click it, then click Add > Loop to add a loop to the user group. Change the iteration number of the loop to 20, check "Control the rate of iterations", and change the rate to 5 per minute. Right-click the loop, then click Add > Test, then choose test "View" to add the test to the current loop.
Fig 2.10 Adjust Properties of User Group
Fig 2.11 Adjust Properties of Loop
Adjust "User Group 2" similarly and finally save the project. Now we have successfully created a schedule.Execute Test Schedule
Right-click the Schedule, and then click Run As > Performance Schedule. Now the schedule will be executed.Check Reports
Once the schedule execution completes, reports will be generated automatically. There are various performance counters grouped as "Page Performance", "Response vs. Time", "Page Throughput", etc. By analyzing the reports, you can make the performance evaluations as well as locate the performance bottleneck.
Fig 2.12 Summary of Schedule Execution
3. Custom Java Code in RPT - Extending the out-of-box functionalities
Like its foundation Eclipse, extensions are welcome by RPT. Basically you can extend how you run your tests by writing custom Java code and calling the code from the test, you can also specify that results from the tests that are affected by your custom code be included in reports.
Test Execution Services
The essential extension support of RPT comes from Test Execution Services (TES), which includes a number of interfaces and classes defined in the com.ibm.rational.test.lt.kernel and its sub-packages.
Parameter tes is provided by RPT test engine, and used by custom Java code to interact with TES. Parameter args is provided through references or field references, which must be included in the tests; within the tests, the references must precede the code that they affect.
Case Study #1: Log JVM Heap Size
In this case study, we'll create custom code to log the maximum JVM heap size. Though it is not very useful here, we're just using this to demonstrate how to create a simple piece of custom code inside a test element.
Case Study #2: Loop Controlling
In this case study, we'll go back to the "Edit" test that was recorded in Section 2. We'll add all the interactions in "Edit" to a 10 times loop, and then use custom code to control the loop -- the loop will be broken if the user name shown in editing page is not as expected. With this case study, you'll familiar yourself with various TES interfaces.
I am NaveenKumar Namachivayam, a performance engineer. My mission is to help and transform manual/automation testers into performance testers and engineers. Also, I love to develop crappy apps, create YouTube tutorials and write about the current trends in performance testing. Thanks for stopping by.
Amazon Elastic Compute Cloud (EC2) provides virtual compute resources to users for running their own applications and allows scalable deployments. This plug-in provides steps for launching instances, terminating instances, associating IP addresses, waiting for instances, creating a security group, and getting the public DNS for the Amazon EC2 tool. The Amazon AWS SDK is required and must be downloaded from Amazon separately. TheUrbanCode Deploy Blueprint Designer can interact with AWS in a more declarative manner, and should be considered as a possible alternative to this plugin.
Amazon Web Services (AWS) Lambda provides on demand computing power for any application or service. Amazon manages the provisioning environments or servers. The AWS Lambda plugin enables you to create, delete, and invoke Lambda functions. The AWS command line interface is required to run this plug-in and must be downloaded and installed separately. Source Code:
Apache Ant is a command line tool that is used to automate the build and deployment of applications. This plug-in calls the Ant executable to run one or more targets defined in a specified Ant script file, and is very useful for quickly integrating legacy automation into your UrbanCode Deploy Processes. IBM UrbanCode Deploy agents include a distribution of Ant, which is used by default, but other versions can be used by providing the path to the Ant installation directory in your Process Step.
The Apache HTTP Server is an open-source HTTP server that can be used on UNIX and Microsoft Windows operating systems. The Apache HTTP Server was developed by the Apache Software Foundation. The Apache HTTP Server provides a secure, efficient and extensible server that provides HTTP services that are compatible with the current HTTP standards. With the steps that this plug-in provides IBM UrbanCode Deploy processes can start and stop the Apache web servers.
The Apache Hadoop software library is a framework that allows for the distributed processing of large data sets across clusters of computers using simple programming models. It is designed to scale up from single servers to thousands of machines, each offering local computation and storage. Rather than rely on hardware to deliver high-availability, the library itself is designed to detect and handle failures at the application layer, so delivering a highly-available service on top of a cluster of computers, each of which may be prone to failures. This plug-in enables you to run a Hadoop application on a NamedNode as part of an UrbanCode Deploy process.
Apache Tomcat is an open source web server and servlet container that is developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Oracle Corporation, and provides a pure Java HTTP web server environment for Java code to run.
3a8082e126