Obtaining performance monitor statistics

To obtain performance monitor statistics, call the logPerfManagerStats method in the Jaguar/Management built in component. The code below is a sample Java client program to call this method:

// PerfDump.java
// This program is supplied on as is basis
// without any guarantees. 
// This Program is not guaranteed to by 
// Sybase to produce required results
// any or all of the time.
//
// Usage: java PerfDump iiop://<hostname>:<iiop port#>

import org.omg.CosTransactions.*;
import org.omg.CORBA.*;
import SessionManager.*;
import com.sybase.jaguar.system.*;

public class PerfDump 
{
    public static void main(String[] str)
    {
        try {
            java.util.Properties props = new java.util.Properties();
            props.put("org.omg.CORBA.ORBClass", "com.sybase.CORBA.ORB");
            ORB orb = ORB.init((String[])null,props);
            Manager manager = ManagerHelper.narrow(orb.string_to_object(str[0]));
            Session session = manager.createSession("jagadmin","");
            Management _mg = ManagementHelper.narrow(session.create("Jaguar/Management"));
            try {
                 _mg.logPerfManagerStats();
            }catch (Exception ex)
            {
                ex.printStackTrace();
            }
        }catch (Throwable th)
        {
           th.printStackTrace();
        }
        System.out.println("Now Refer to EAServer's Log file for Performance Monitor Information");
    }
}

EAServer writes statistics to the server log file. These include statistics for each component and stack traces for each thread. Statistics for each component include the component name, number of current active instances, number of instances waiting to execute and average response time. A response time value of -1.00 indicates that the component is not being monitored. Here is example output:

Apr 15 20:45:32 2004: [0000004692] ******** PERFORMANCE MONITOR STATISTICS START ********
Apr 15 20:45:32 2004: [0000004692] Name                       Active      Waiting    Response
Apr 15 20:45:32 2004: [0000004692]                           Instances   Instances     Time
Apr 15 20:45:32 2004: [0000004692] ----------------------------------------------------------
Apr 15 20:45:32 2004: [0000004692] CosNaming/JNameService     00000        00000     -1.00    
Apr 15 20:45:32 2004: [0000004692] Jaguar/HttpStatProviderCon 00000        00000     -1.00    
Apr 15 20:45:32 2004: [0000004692] JaguarOTS/OtsService       00000        00000     -1.00    
Apr 15 20:45:32 2004: [0000004692] CtsComponents/MessageServi 00032        00000     -1.00    
Apr 15 20:45:32 2004: [0000004692] ----------------------------------------------------------

The stack trace listing shows the execution stack for each thread. When you suspect a deadlock condition, the stack shows which entity is being blocked and the calling sequence that caused the block. As show in the stack trace below, the ***BLOCKED*** token is printed when the entity execution is blocked. In this example, the call is blocked when trying to execute the j2eebookstore/customer component. The stack sequence indicates that this component is recursive: j2eebookstore/customer has called j2eebookstore/customer. Also from the stack it is evident that the client is connected to the port defined by Jaguar_iiop listener:

Apr 15 20:45:32 2004: [0000004692] *************STACK TRACES START ***************
Apr 15 20:45:32 2004: [0000004692] Thread:134938976
Apr 15 20:45:32 2004: [0000004692] CtsComponents/MessageService
Apr 15 20:45:32 2004: [0000004692] CtsComponents/MessageThread
Apr 15 20:45:32 2004: [0000004692] -------------------------------------------
Apr 15 20:45:32 2004: [0000004692] Thread:134642792
Apr 15 20:45:32 2004: [0000004692] *******BLOCKED*******
Apr 15 20:45:32 2004: [0000004692] j2eebookstore/customer
Apr 15 20:45:32 2004: [0000004692] j2eebookstore/customer
Apr 15 20:45:32 2004: [0000004692] Jaguar_iiop
Apr 15 20:45:32 2004: [0000004692] -------------------------------------------