Skip to Content
Finding bottle necks in your code can sometimes be difficult especially if you are reviewing someone else’s code. So when I came across TPTP from Eclipse I was interested in trying to get it working for analyzing my portal developments. The Eclipse Test and Performance Tools Platform (TPTP) project is a top level project from the Eclipse Foundation, at least that’s what is says on their website ;-). It is made up of four parts which you can read about there. In order to setup my system to use TPTP I required the following:

  • 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
    -Djava.library.path=C:\raserver\bin
  • Also in the Config Tool for each server set the JAVA Parameter
    -XrunpiAgent

image

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.
  • image

  • Then select the agent you want to connect to, you will see the PID corresponds to the PID of the Server JLaunch process.
  • image

  • 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.
  • image

  • Under the destination folder choose the project you want to profile.
  • image

  • Then click “Profile” and you should see under the profiling tab the process you have attached to.
  • image

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.

image

You can then navigate to the source code and workout what the problem is.

image

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.

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

Leave a Reply