Implementing Mercury J2EE Diagnostics with LoadRunner!
Posted: April 21st, 2008 | Author: TnT Admin | Filed under: How-Tos | Tags: J2EE Diagnostics, LoadRunner | 13 Comments »
You should have the following with you prior the entire setup. If you are still unsure of the different components in a Mercury J2EE Diagnostics setup, I recommend you to revisit the article, “What’s Diagnostics?”, to gain a better understanding better before proceeding:
- 1. Mercury Diagnostics Server Installation Disc
2. Mercury Diagnostics J2EE Probe Installation Disc
3. Mercury LoadRunner Installation Disc (prior to LR 9.0, the AddIn is found on the Additional Feature Disk).
4. J2EE Diagnostics Module license for LoadRunner
5. Mercury Diagnostics license for Diagnostics Server
6. Mercury Diagnostics Server and Probe Installation and Configuration Documentation
What you need to know in advance:
- 1. The JRE information of the Application Server.
2. The location of the application startup script (not the WebLogic server startup script).
We will use the term Profiler and Probe interchangeably for the purpose of this article. In the setup, I’m using the following:
- 1. Mercury Diagnostics Server 6.5
2. Mercury Diagnostics Probe 6.5
3. Mercury LoadRunner 8.1 FP4
4. BEA Weblogic 8.1 SP5
5. BEA sample Application Server – Avitek TM Medical Records
6. Sun JRE 1.4.2_08
7. TCP 2006 opened for two-way communication from LoadRunner Controller machine to Diagnostics Server machine
8. TCP 2612 opened for two-way communication from Diagnostics Server machine to Application Server machine
9. TCP 35000 opened locally on Application Server machine.
Also, note that the explanation will be based on Windows environment although concepts are generally similar. Therefore, if you are installing in a Unix environment, please refer to the Mercury Diagnostics Installation and Configuration Guide. The implementation will also be based on the following illustration.
Mercury J2EE Diagnostics Implementation
Enough said, let’s walk through the steps for installation and configuration together.
An overview of the implementation is as followed:
- 1. Install the Diagnostics Server
2. Install the Diagnostics AddIn on the LoadRunner Controller
3. Install the Diagnostics J2EE Probe on the Application Server
4. Run the Diagnostics J2EE Instrumenter and instrument the application startup script.
5. Ensure that statistics are collected and displayed on the Diagnostics J2EE Probe/Profiler
6. Ensure that statistics are collected and displayed on the Diagnostics Server
7. Ensure that statistics are collected and displayed on the LoadRunner Controller.
Installation
1. Verify the compatibility of the Diagnostics Server, Probe and LoadRunner with the support crew first. Sometimes, the server may not be fully integrated with LoadRunner and may end you up in circles without the proper support.
2. Install Diagnostics Server on a machine in the network with the Mercury Diagnostics Server Installation Disk.
a. The installation process is pretty straight-forward so just follow through it. Once you’ve reached the selection of the Diagnostics Server Mode, select “Commander Mode” as there is only one Diagnostics Server available in the setup. The following setup are optional and dependent on your existing architectural setup.
b. Once the installation has completed, on the Diagnostic Server machine, select All Programs > Mercury Diagnostics Server > Administration to launch Diagnostics Server in the browser. If it is not started, select All Programs > Mercury Diagnostics Server > Start Mercury Diagnostics Server. By default, Diagnostics Server service should be started after the installation as well as every startup of the OS.
Tip:
For any reason, that username and password is required, the default is username: admin and password: admin.
c. Place the Mercury Diagnostics license information here. (In anyway, you won’t be able to view any data in the Diagnostics Server if the license information is not entered and also it will consistently prompt you for the license.)
d. Verify the Diagnostics Server is working such as the functionality by launching the browser and pointing to the following URL:
- http://localhost:2006
or
http://{diagnostics-server}:2006 where {diagnostics-server} is the hostname of the Diagnostics Server.
Note:
If you have a complex setup of mutliple J2EE Application Servers that you would like to monitor, you may need to spread the load of the Diagnostics Commander Server to many Diagnostics Mediator Server. The Mediator Servers are to ease the processing of the information before being consolidated at the Diagnostics Commander. For more information, refer to the article, “What’s Diagnostics?”.
3. Install the Diagnostics AddIn on the LoadRunner Controller machine using the Mercury LoadRunner Installation Disc. If you are working on LR8.1FP4 and earlier, the AddIn is found in the Additional Feature disc. After the installation, place the J2EE Diagnostics Module license information in LoadRunner and connect to the Diagnostics Server at port 2006. This is done by configuring in the LaunchPad (Select All Programs > Mercury LoadRunner > LoadRunner > Configuration > Diagnostics for J2EE/.NET setup)
4. Install the Mercury Diagnostic J2EE Probe on the Application Server. The installation process is pretty straight-forward so just follow through it. Once you’ve reached the selection for installing it as a standalone Profiler to work with a Diagnostics Server, select to “Install the probe to work with a Mercury Diagnostics Server” since we’ve got the Diagnostics Server ready.
a. Provide a Probe Name for the the probe, e.g. Avitek_J2EE_Probe. You can also provide the Probe Group which we will use the “Default” Probe Group. (Refer to the Mercury Diagnostics User’s Guide for more information of the names and groups in Diagnostics and if you need to change the names and groups in future).
b. Provide the Diagnostics Server Mediator Host information which include the hostname and the port that the Diagnostics Server is utilizing. By default, it’s port 2006.
Note:
1. You can install the probe as a standalone profiler and it will still work with the proper instrumentation. However, the result that is been displayed at the profiler will be runtime and you will not be able to store it for analyzing at a later stage. This will be useful if you need to monitor the application server with minimal setup.2. In the Instrumentation Tool, you can also add JVMs if they are not detected by the tool.
Instrumentation
5. After the installation, run the JRE Instrumenter from All Programs > Mercury Diagnostics J2EE Probe > JRE Instrumenter. Select the JRE that was previously configured in the probe installation process (Sun JRE 1.4.2_08 in C:\MercuryDiagnostics\JavaProbe\classes\Sun\1.4.2_08) and the JVM parameter is displayed in the bottom window. This JVM parameter will be added to the application startup script for instrumentation purposes. As such, click “Copy Parameter” to copy the JVM parameter.
6. Locate the application startup script. For the sample application, Avitek Medical Record, it’s located in the following directory. Open the startup script with a notepad to edit the startup process.
C:\bea\weblogic\samples\domains\medrec\startMedRecServer.cmd
Tip:
If you are unsure of the location, check with the developers or the Application Server team. Alternatively, you can also find the directory with the console that starts the application server.
7. Find the statement that starts the application server and add the JVM parameter from point [5]. Two samples of the startup script before and after are included for your reference and can be downloaded in the respective link.
- Before-Instrumentation
“%JAVA_HOME%\bin\java” %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%
-Dweblogic.Name=%SERVER_NAME%
-Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE%
-Djava.security.policy=”%WL_HOME%\server\lib\weblogic.policy”
weblogic.Server
“%JAVA_HOME%\bin\java” %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS%
-Dweblogic.Name=%SERVER_NAME%
-Dweblogic.ProductionModeEnabled=%PRODUCTION_MODE%
-Djava.security.policy=”%WL_HOME%\server\lib\weblogic.policy” “-Xbootclasspath/p:C:\MercuryDiagnostics\JAVAProbe\classes\Sun\1.4.2_08;
C:\MercuryDiagnostics\JAVAProbe\classes\boot”
weblogic.Server
8. Save the amended application startup script and restart the entire application server. (Not necessarily the Weblogic Server needs to be restarted.)
9. Now, from the Start menu, select All Programs > Mercury Diagnostics J2EE Probe > Diagnostics Profiler for J2EE. This will launch the J2EE Profiler in its applet format. Click on the link, “Connect to Mercury Diagnostics Profiler” and wait awhile for the profiler loads. When the Profiler is fully loaded, you should be able to see statistics being collected (below) and displayed in the profiler if the steps taken from [5] to [7] were completed successfully.
Diagnostics Profiler for J2EE
You can also launch a browser with the following URL to view the statistics as illustrated in the below diagram.
- http://localhost:35000
or
http://{application-server}:35000 where {application-server} is the hostname of the Application Server
Diagnostics Profiler for J2EE via Browser
Tip:
For any reason, that username and password is required, the default is username: admin and password: admin.
Connecting to the Diagnostics Server
10. Go to the Diagnostics Server. Launch a browser and enter the following URL:
- http://localhost:2006
or
http://{diagnostics-server}:2006 where {diagnostics-server} is the hostname of the Diagnostics Server.
With a valid license, you should be able to see statistics from the browser.
Connecting to the LoadRunner Controller
11. Go to the LoadRunner Controller machine. Click on the Diagnostics for J2EE/.NET Tab, you should be able to see the JVM statstics being collected and displayed. It’s a similar interface as the Diagnostics Server which means all data are successfully collected and transmitted from the Probe to the Diagnostics Server and finally to the LoadRunner Controller. Hopefully you can understand that it is necessary to have the probe working, followed by the Diagnostics Server working before LoadRunner Controller can displayed and log the data.
For the usage and advanced configuration of the Diagnostics Server and Probe, I highly recommend you to go through the Mercury Diagnostics User’s Guide and Mercury Diagnostics Installation and Configuration Guide.
With that, I hoped I provide sufficient information for you to fully

Can somebody share me the Mercury Diagnostics User’s Guide and Mercury Diagnostics Installation and Configuration Guide. kaushik.guchhait@cognizant.com
The Diagnostics User Guide, Installation and Configuration Guide comes together with the Diagnostics installer DVD set. Also you can go to the vendor website to download the documents.
I m going through the Proof of Concept phase and upon doing so, will move forward for procurement of the software. FOr the same, it would have been of immense help, if you could have shared those docs withme?
The guides can be downloaded from HP Software Support website at http://h20230.www2.hp.com/. You will be required to register.
Please any body tell me what is load runner diagnostics?
You can refer to “What’s Diagnostics” for more information.
Can Somebody help me understand what are the Diagnostics JDBC connection pool size, JVM heapsize and Thread Pool size we measure while running a Load Test
Hi, I believed that you may be unfamiliar with those terms and therefore I recommend the following sites to go through:
* http://en.wikipedia.org/wiki/Connection_pool
* http://www.j2eeperformance.com/
* http://www.javaperformancetuning.com/tips/j2ee.shtml
i just want to make sure that i can do diagnostics on bothe .net application and Web applications?? and do i need license for each or both are included ? thanks
Hi, we have application which is deployed in Weblogic server (1 admin serverm 2 manager servers). Can you please let me know how to configure the diagnostics in Weblogic cluster environment? previously we did multiple tests on weblogic stand alone installations.
Hi Lina,
.NET Diagnostics requires licenses on the Controller as well as the Diagnostics Server. As for Webpage Diagnostics, its not licensed.
Can anybody tell the license cost of the HP Mercury Diagnostic Profiler?
Hi Akshay,
You need to work out with the sales representatives of your region on the pricing.