Working with the J2EE Request Profiler Sample

Introduction

This sample demonstrates the usage of the J2EE Request Profiler in WebSphere Application Server version 5.0 or higher. The J2EE Request Profiler is an agent that resides within the WebSphere Application Server process for the purpose of collecting data from the interception points of the e-business application's requests. The J2EE Request Profiler uses the Agent Controller to externalize this data so that it can be rendered by the various views provided by the Profiling perspective of the workbench.

Profiling of distributed e-business applications that run either within the boundaries of one machine or on a cluster of machines is accomplished by using either a single instance or several instances of the J2EE Request Profiler. Each instance of the J2EE Request Profiler is responsible for collecting profiling information for the WebSphere Application Server process that it resides within. Attaching to a number of J2EE Request Profilers on different application servers enables the collection of profiling data across these servers.

You can select the J2EE Request Profiler that you want to attach to, and you can also choose when you want to attach during the application's execution. Tracing of the application starts from the moment you attach to the J2EE Request Profiler, and start monitoring the application. As the execution of the application crosses the boundaries of a host, the remote discovery mechanism causes the attachment to other instances of the J2EE Request Profiler. These instances represent WebSphere Application Servers (version 5.0 or higher). These WebSphere Application Servers host servlets and enterprise beans that participate in the application's execution.

Note:

The J2EE Request Profilers collect data from requests arriving on EJB containers as well as web containers. This data collection mechanism enables the creation of sequence diagrams, which represent interactions among servlets, JSPs, and enterprise beans, while ignoring other artifacts of the application infrastructure that do not represent the business logic of the application. The collected data enables the creation of a variety of different diagrams, which are defined for specific levels of the profiling hierarchy (monitors, hosts, processes and agents). The Sequence Diagram views of the Profiling perspective offer the following currently implemented diagram types:

The Sequence Diagram view shows details about the application from the point in time at which you attach to the J2EE Request Profiler and start monitoring the application.

Contents

The contents of the sample consist of the dependencies (that is, the JAR files) necessary to monitor the J2EE Request Profiler and view data collected from the interception points of the e-business application's requests by means of the IBM Agent Controller, the workbench and the J2EE Request Profiler in the WebSphere Application Server (version 5.0 or higher).

Requirements

The WebSphere Application Server (version 5.0 or higher) is required to execute this sample.
Note:
This application is not supplied.

Assumptions

When attaching to a J2EE Request Profiler using the workbench, the Agent Controller is installed and running.

Dependencies

The JAR files that are listed in the table are required to execute this sample:

JAR file Plug-in it is contained in
hexr.jar org.eclipse.hyades.execution.remote
hcorrelation.jar org.eclipse.hyades.execution.correlation
hexl.jar org.eclipse.hyades.execution.local
sdrt.jar com.ibm.etools.pd.sd.runtime.sample
(within the archive\J2EERequestProfilerSample directory)

Execution Steps

To run this sample, follow these steps:

  1. Stop the WebSphere Application Server (version 5.0 or higher).
  2. Add the necessary dependency JAR files from this project (that is, J2EERequestProfilerProject) to the lib directory of the WebSphere Application Server, for example, x:\Program Files\WebSphere\AppServer\lib on Windows or /opt/WebSphere/AppServer/lib on UNIX.
  3. Start the WebSphere Application Server.
  4. Enable profiling in the Profiling and Logging preferences of the workbench:
    1. From the toolbar, select Window > Preferences.
    2. Select Profiling and Logging.
    3. In the Profiling and Logging pane, select Enable profiling.
    4. Select OK to apply the changes.
  5. Start the IBM Agent Controller service (on Windows) or the daemon (on UNIX).
  6. Open the Profiling and Logging perspective in the workbench:
    1. Select Window > Open Perspective > Other.
    2. Select Profiling and Logging.
    3. Select OK.
  7. Attach to the J2EE Request Profiler profiling agent:
    1. Select Profile from the toolbar. The launch configuration window opens.
    2. Select Attach - Java Process from the Configurations list.
    3. Click New to create a new configuration.
    4. In the new configuration pane, specify a name for the profile configuration in the Name field.
    5. Select the Agents tab.
    6. Select the J2EE Request Profiler from the Agents list using the arrow keys.
    7. Click Profile to begin profiling the application.
  8. In the Profiling Monitor view, right-click on the profiling agent and select Start Monitoring. Data will now be collected.
  9. Run a WebSphere Application Server J2EE sample (for example, Stateless Session - Basic Calculator).
  10. Open one of the Profiling and Logging perspective's profiling views to view profiling data that is acquired from running the WebSphere Application Server 5.0 or the above J2EE sample, in real time. To open a view:
    1. In the Profiling Monitor view, right-click on the profiling agent and select Open with.
    2. Select one of the views listed.
    Note: More information on application profiling and the profiling views of the Profiling perspective can be found in the online documentation (Help > Help Contents > Search: > 'Application Profiling Perspective' > GO).
  11. In the Profiling Monitor, select the Refresh Views button to refresh the views.



(C) Copyright IBM Corporation 2000, 2004. All Rights Reserved.