- JDK 1.4.2
- Eclipse SDK 3.1.2 (which unfortunately means you can’t use NWDS)
- Eclipse Modeling Framework (EMF) SDK 2.1.2
- XML Schema Infoset Model (XSD) SDK 2.1.2
- TPTP 4.1.0
- TPTP Agent Controller (in my case for Windows)
Once you have downloaded all the requirements, follow the installation instructions from Eclipse, but basically TPTP, EMF and XSD are installed as plugins to the Eclipse SDK… so if you are familiar with Eclipse it is fairly straight forward. And the agent is basically an executable you can run manually when you need it or as a Windows service.
In order to get it working with Netweaver Web AS 6.40 and the portal I needed to make the following settings:
- Set the PATH system variable to include the location of the TPTP Agent bin folder (e.g. c:\raserver\bin).
- Using Web AS Config Tool for each server you wish to use add the location of the Agent bin folder to the JAVA Library Path
- Also in the Config Tool for each server set the JAVA Parameter
Now you can start your Server and TPTP Agent.
Profiling itself is done via Eclipse in the profiling and logging perspective. I started by importing the portal project I wanted to profile. Then in the Eclipse menu choose “Run –> Profile”. Follow these steps that describe how to create a new configuration and attach to the JAVA Process of the J2EE Engine.
- Select the host you want to connect to (if you are running it locally you can choose “local direct connection”. This is to connect to the agent controller.
- Then select the agent you want to connect to, you will see the PID corresponds to the PID of the Server JLaunch process.
- Create a new Profiling Set. Here you can specify which packages to monitor, so if you only want to see profiling info for your com.companyname.* classes you can exclude all the standard SAP and JAVA ones here.
- Under the destination folder choose the project you want to profile.
- Then click “Profile” and you should see under the profiling tab the process you have attached to.
You can now click on the green arrow to start monitoring. Then run your code in the portal and the profiling information will be gathered and displayed to you in Eclipse. In the example below you can see that the doContent method of my TPTPDemo Class is taking a considerable amount of time to execute.
You can then navigate to the source code and workout what the problem is.
Although this is a bit of a pain to setup and configure and I wish that NWDS had something similar built into it, I have found Eclipse TPTP a very useful tool for finding bottlenecks and performance issues in my code I hope you will too.