Google

Cocoon API: Class Profiler

org.apache.cocoon
Class Profiler

java.lang.Object
  |
  +--org.apache.cocoon.Profiler
All Implemented Interfaces:
Actor, Status

public class Profiler
extends java.lang.Object
implements Actor, Status

Records how long certain processes takes for each request. startEvent () and finishEvent () should be called at the start and end of each process. Use getProfileTable to get the results as a DOM.

Version:
$Revision: 1.2 $ $Date: 2000/12/09 01:11:30 $
Author:
Robin Green

Inner Class Summary
protected  class Profiler.ProfProcess
           
static class Profiler.RequestMarker
          We cannot guarantee that the request object will not be recycled by the servlet runner, so use RequestMarker instead.
 
Field Summary
static java.text.DateFormat DATE_FORMAT
           
protected  java.util.Vector eventNames
          This should be a ListSet.
protected  Logger logger
           
protected  java.util.Vector requestOrder
           
protected  java.util.Hashtable requests
          This should be a ListMap.
 
Constructor Summary
Profiler()
           
 
Method Summary
 void clear()
           
 void finishEvent(Profiler.RequestMarker request, java.lang.Class event)
           
 void finishEvent(Profiler.RequestMarker request, java.lang.String event)
           
 org.w3c.dom.Element getProfileTable(org.w3c.dom.Document dest)
           
protected  java.util.Hashtable getRequestMap(Profiler.RequestMarker request)
           
 java.lang.String getStatus()
          Returns information about the status of the implementing class.
 void init(Director director)
          Initialize the actor by indicating their director.
 java.lang.String mangleName(java.lang.String name)
           
 void startEvent(Profiler.RequestMarker request, java.lang.Class event)
           
 void startEvent(Profiler.RequestMarker request, java.lang.String event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_FORMAT

public static final java.text.DateFormat DATE_FORMAT

logger

protected Logger logger

requests

protected java.util.Hashtable requests
This should be a ListMap.

requestOrder

protected java.util.Vector requestOrder

eventNames

protected java.util.Vector eventNames
This should be a ListSet.
Constructor Detail

Profiler

public Profiler()
Method Detail

init

public void init(Director director)
Description copied from interface: Actor
Initialize the actor by indicating their director.
Specified by:
init in interface Actor

startEvent

public void startEvent(Profiler.RequestMarker request,
                       java.lang.Class event)

startEvent

public void startEvent(Profiler.RequestMarker request,
                       java.lang.String event)

finishEvent

public void finishEvent(Profiler.RequestMarker request,
                        java.lang.Class event)

finishEvent

public void finishEvent(Profiler.RequestMarker request,
                        java.lang.String event)

mangleName

public java.lang.String mangleName(java.lang.String name)

clear

public void clear()

getProfileTable

public org.w3c.dom.Element getProfileTable(org.w3c.dom.Document dest)

getRequestMap

protected java.util.Hashtable getRequestMap(Profiler.RequestMarker request)

getStatus

public java.lang.String getStatus()
Description copied from interface: Status
Returns information about the status of the implementing class. Note: this is use instead of the usual toString() method because some of these methods are declared final in some classes in JDK 1.1.
Specified by:
getStatus in interface Status


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.