org.webmacro.profile
Class ProfileCategory

java.lang.Object
  |
  +--org.webmacro.profile.ProfileCategory

public class ProfileCategory
extends java.lang.Object

A ProfileCategory manages Profile objects for a category.


Constructor Summary
protected ProfileCategory(java.lang.String name, int samplingRate, int recordTime)
          Record time is how long we are to record profiles.
 
Method Summary
 java.lang.String getName()
           
 Profile[] getProfiles()
          Get the current Profiles
 Profile newProfile()
          Instantiate a new Profile.
protected  void record(Profile p)
          Add the profiler to the record queue, and clean out any profilers that have been hanging around for too long.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProfileCategory

protected ProfileCategory(java.lang.String name,
                          int samplingRate,
                          int recordTime)
Record time is how long we are to record profiles. After the specified amount of record time we will discard old profiles.
Method Detail

getName

public final java.lang.String getName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

newProfile

public Profile newProfile()
Instantiate a new Profile. If a null object is returned then no profiling is to be done. The returned object will be the root of a Profile stack trace. Call its start() and stop() methods to record timing data.

Concurrency: this method is thread-safe. You may call it from multiple threads.


record

protected final void record(Profile p)
Add the profiler to the record queue, and clean out any profilers that have been hanging around for too long.

getProfiles

public final Profile[] getProfiles()
Get the current Profiles