This tutorial explains how to profile Java code running with Java Web Server 1.1.3 and JDK 1.1.6

In this document:

     <OptItDir> is the directory where OptimizeIt has been installed. (ex: c:\OptimizeIt\OptimizeIt302D)
     <JavaWebServer> is the directory where Java Web Server has been installed (ex: c:\JavaWebServer1.1.3)

1) Configuring the Java Web Server

2) Launching the Java Web Server

3) Start the OptimizeIt servlet

Once this operation is done, you should see a message in your web browser indicating that OptimizeIt's audit system is running.

4) Attaching from OptimizeIt

Now that Java Web Server is running with OptimizeIt profiler, you can start OptimizeIt and attach to the virtual machine.

Note: OptimizeIt does not have a "detach" function. If you press the stop button in OptimizeIt, the Java Web Server is stopped. You will have to restart it from the administrator page (http://localhost:9090) and to invoke the OptimizeIt servlet to restart the profiler.

5) Filtering resources used by the Java Web Server

OptimizeIt provides filters for filtering resources used by the Java Web Server. In order to use filters, you must create an OptimizeIt setting for the profiling session,  turn on the the Java Web Server filter, and then attach by using the Attach now button or pressing the play button.

Note: OptimizeIt settings can be saved for subsequent usage. This is done by using the save menu.

6) Starting OptimizeIt profiler from your Java code

While the OptimizeIt servlet is convenient to start profiling quickly, you may want to automatically start OptimizeIt profiler with one of your servlet. That way, you don't have to invoke the OptimizeIt servlet to start the audit system before testing your servlets.

Starting OptimizeIt profiler can be easily done by using OptimizeIt's API. OptimizeIt's API is documented in OptimizeIt user manual, chapter 9. The following code demonstrates how to start the profiler from your servlet:
 

import intuitive.audit.Audit;
...
static boolean isProfilerStarted = false;
 if(!isProfilerStarted) {
        /* Start OptimizeIt's profiler */
        Audit.start(1470, Audit.PROFILERS_ALWAYS_ENABLED);
   isProfilerStarted = true;
  }
...

Note: you will need to add <OptItDir>\lib\optit.jar to compile this code

Once OptimizeIt's profiler is running, you can start OptimizeIt and attach to the servlet engine.

Copyright (c) 1997, 1998, 1999 Intuitive Systems Inc. All rights reserved. Specifications subject to change without notice.
OptimizeIt is a trademark of Intuitive Systems, Inc.
Java and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. All other brand
names and products are trademarks or registered trademarks of their respective holders.