org.webmacro.profile
Class Profile

java.lang.Object
  extended byorg.webmacro.profile.Profile

public final class Profile
extends java.lang.Object


Field Summary
protected  long timestamp
          ProfileCategory uses this to manage us
 
Constructor Summary
protected Profile(ProfileCategory owner)
          only our ProfileCategory should create new instances
 
Method Summary
 void destroy()
          Terminate profiling, releasing any resources allocated to this Profile and forwarding any collected statistics back to the ProfileSystem.
 java.util.Iterator getEvents()
          Retrieve a list of the events in this profile.
static void main(java.lang.String[] arg)
           
protected  void reset()
          This method resets the data structures for this Profile so it can be re-used.
 void startEvent(java.lang.String name)
          Start timing an event called 'name'.
 void stopEvent()
          Stop timing the last event started.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timestamp

protected long timestamp
ProfileCategory uses this to manage us

Constructor Detail

Profile

protected Profile(ProfileCategory owner)
only our ProfileCategory should create new instances

Method Detail

getEvents

public java.util.Iterator getEvents()
                             throws java.lang.IllegalStateException
Retrieve a list of the events in this profile. The returned iterator will cycle through the ProfileEvent objects that were generated during the execution of this Profile.

Throws:
java.lang.IllegalStateException

reset

protected void reset()
This method resets the data structures for this Profile so it can be re-used. Ordinarily only our controlling category will call this method.


startEvent

public void startEvent(java.lang.String name)
Start timing an event called 'name'. You *MUST* call stop() later in order to get valid results.


stopEvent

public void stopEvent()
Stop timing the last event started. You *MUST* have called start() prior to this in order to get coherent results.

Throws:
java.lang.IllegalStateException - if stopEvent called too many times

destroy

public void destroy()
Terminate profiling, releasing any resources allocated to this Profile and forwarding any collected statistics back to the ProfileSystem. It is expected that implementations will use this method to recycle the Profile objects themselves for efficiency.


main

public static void main(java.lang.String[] arg)