EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference

org.eclipse.persistence.tools.profiler
Class PerformanceProfiler

java.lang.Object
  extended by org.eclipse.persistence.tools.profiler.PerformanceProfiler
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, SessionProfiler

public class PerformanceProfiler
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable, SessionProfiler

Purpose: A tool used to provide high level performance profiling information.

See Also:
Serialized Form
Author:
James Sutherland
Since:
TopLink 1.0

Field Summary
protected  int nestLevel
           
protected  long nestTime
           
protected  java.util.Hashtable operationStartTimes
           
protected  java.util.Hashtable operationStartTimesByThread
           
protected  java.util.Hashtable operationTimings
           
protected  java.util.Hashtable operationTimingsByThread
           
protected  java.util.Vector profiles
           
protected  long profileTime
           
protected  org.eclipse.persistence.internal.sessions.AbstractSession session
           
protected  boolean shouldLogProfile
           
 
Fields inherited from interface org.eclipse.persistence.sessions.SessionProfiler
ALL, AssignSequence, CACHE, CachedObjects, CacheHits, CacheMisses, CacheNounType, Caching, ChangeSetsNotProcessed, ChangeSetsProcessed, ClientSessionCreated, CONNECT, ConnectionInUse, ConnectionManagement, ConnectionNounType, ConnectionPing, DatabaseExecute, DeletedObject, DescriptorEvent, DistributedMerge, DistributedMergeDmsDisplayName, HEAVY, JtsAfterCompletion, JtsBeforeCompletion, Logging, LoggingDMSDisPlayName, LoginTime, Merge, MergeTime, MiscellaneousNounType, NONE, NORMAL, OBJECT_BUILDING, ObjectBuilding, OptimisticLockException, QUERY_PREPARE, QueryNounType, QueryPreparation, RcmNounType, RcmReceived, RcmSent, RcmStatus, Register, RemoteChangeSet, ROW_FETCH, RowFetch, Sequencing, SessionEvent, SessionName, SessionNounType, SQL_GENERATION, SQL_PREPARE, SqlGeneration, SqlPrepare, STATEMENT_EXECUTE, TlConnects, TlDisconnects, TopLinkRootNoun, TRANSACTION, TransactionNounType, UnitOfWorkRegister, UowCommit, UowCreated, UowRollbacks, Wrapping
 
Constructor Summary
PerformanceProfiler()
          PUBLIC: Create a new profiler.
PerformanceProfiler(boolean shouldLogProfile)
          PUBLIC: Create a new profiler.
PerformanceProfiler(Session session)
          OBSOLETE: Create a new profiler.
PerformanceProfiler(Session session, boolean shouldLogProfile)
          OBSOLETE: Create a new profiler.
 
Method Summary
protected  void addProfile(Profile profile)
           
 Profile buildProfileSummary()
          INTERNAL: Return a summary profile reporting on the profiles contained.
 java.util.Hashtable buildProfileSummaryByClass()
          INTERNAL: Return a map of summary profiles reporting on the profile contained.
 java.util.Hashtable buildProfileSummaryByQuery()
          INTERNAL: Return a map of summary profiles reporting on the profile contained.
 java.lang.Object clone()
           
 void dontLogProfile()
          PUBLIC: Set whether after each query execution the profile result should be logged.
 void endOperationProfile(java.lang.String operationName)
          INTERNAL: End the operation timing.
 void endOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)
          INTERNAL: End the operation timing.
protected  int getNestLevel()
           
protected  long getNestTime()
           
protected  java.util.Hashtable getOperationStartTimes()
           
protected  java.util.Hashtable getOperationStartTimesByThread()
           
protected  java.util.Hashtable getOperationTimings()
           
protected  java.util.Hashtable getOperationTimingsByThread()
           
 java.util.Vector getProfiles()
          Return the profiles logged in this profiler.
protected  long getProfileTime()
           
 int getProfileWeight()
          INTERNAL: Return DMS sensor weight(DMS)
 org.eclipse.persistence.internal.sessions.AbstractSession getSession()
           
 void initialize()
          INTERNAL: Initialize EclipseLink noun tree(DMS)
 void logProfile()
          PUBLIC: Set whether after each query execution the profile result should be logged.
 void logProfileSummary()
          PUBLIC: Log a profile summary.
 void logProfileSummaryByClass()
          PUBLIC: Log a profile summary by class.
 void logProfileSummaryByQuery()
          PUBLIC: Log a profile summary by query.
 void occurred(java.lang.String operationName)
          INTERNAL: Increase DMS Event sensor occurrence.
 java.lang.Object profileExecutionOfQuery(DatabaseQuery query, Record row, org.eclipse.persistence.internal.sessions.AbstractSession session)
          INTERNAL: Finish a profile operation if profiling.
protected  void setNestLevel(int nestLevel)
           
protected  void setNestTime(long nestTime)
           
protected  void setOperationStartTimes(java.util.Hashtable operationStartTimes)
           
protected  void setOperationStartTimesByThread(java.util.Hashtable operationStartTimesByThread)
           
protected  void setOperationTimings(java.util.Hashtable operationTimings)
           
protected  void setOperationTimingsByThread(java.util.Hashtable operationTimingsByThread)
           
protected  void setProfiles(java.util.Vector profiles)
           
protected  void setProfileTime(long profileTime)
           
 void setProfileWeight(int weight)
          INTERNAL: Set DMS sensor weight(DMS)
 void setSession(Session session)
          INTERNAL: Set the session.
 void setShouldLogProfile(boolean shouldLogProfile)
          PUBLIC: Set whether after each query execution the profile result should be logged.
 boolean shouldLogProfile()
           
 void startOperationProfile(java.lang.String operationName)
          INTERNAL: Start the operation timing.
 void startOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)
          INTERNAL: Start the operation timing.
 void update(java.lang.String operationName, java.lang.Object value)
          INTERNAL: Update the value of the State sensor.
protected  void writeNestingTabs(java.io.Writer writer)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

profiles

protected java.util.Vector profiles

session

protected transient org.eclipse.persistence.internal.sessions.AbstractSession session

shouldLogProfile

protected boolean shouldLogProfile

nestLevel

protected int nestLevel

nestTime

protected long nestTime

profileTime

protected long profileTime

operationTimings

protected java.util.Hashtable operationTimings

operationStartTimes

protected java.util.Hashtable operationStartTimes

operationTimingsByThread

protected java.util.Hashtable operationTimingsByThread

operationStartTimesByThread

protected java.util.Hashtable operationStartTimesByThread
Constructor Detail

PerformanceProfiler

public PerformanceProfiler()
PUBLIC: Create a new profiler. The profiler can be registered with a session to log performance information on queries.


PerformanceProfiler

public PerformanceProfiler(Session session)
OBSOLETE: Create a new profiler. The profiler can be registered with a session to log performance information on queries.


PerformanceProfiler

public PerformanceProfiler(Session session,
                           boolean shouldLogProfile)
OBSOLETE: Create a new profiler. The profiler can be registered with a session to log performance information on queries.


PerformanceProfiler

public PerformanceProfiler(boolean shouldLogProfile)
PUBLIC: Create a new profiler. The profiler can be registered with a session to log performance information on queries.

Method Detail

addProfile

protected void addProfile(Profile profile)

buildProfileSummary

public Profile buildProfileSummary()
INTERNAL: Return a summary profile reporting on the profiles contained.


buildProfileSummaryByClass

public java.util.Hashtable buildProfileSummaryByClass()
INTERNAL: Return a map of summary profiles reporting on the profile contained.


buildProfileSummaryByQuery

public java.util.Hashtable buildProfileSummaryByQuery()
INTERNAL: Return a map of summary profiles reporting on the profile contained.


clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

dontLogProfile

public void dontLogProfile()
PUBLIC: Set whether after each query execution the profile result should be logged. Bu default this is true.


endOperationProfile

public void endOperationProfile(java.lang.String operationName)
INTERNAL: End the operation timing.

Specified by:
endOperationProfile in interface SessionProfiler

endOperationProfile

public void endOperationProfile(java.lang.String operationName,
                                DatabaseQuery query,
                                int weight)
INTERNAL: End the operation timing.

Specified by:
endOperationProfile in interface SessionProfiler

getNestLevel

protected int getNestLevel()

getNestTime

protected long getNestTime()

getOperationStartTimes

protected java.util.Hashtable getOperationStartTimes()

getOperationStartTimesByThread

protected java.util.Hashtable getOperationStartTimesByThread()

getOperationTimings

protected java.util.Hashtable getOperationTimings()

getOperationTimingsByThread

protected java.util.Hashtable getOperationTimingsByThread()

getProfiles

public java.util.Vector getProfiles()
Return the profiles logged in this profiler.


getProfileTime

protected long getProfileTime()

getSession

public org.eclipse.persistence.internal.sessions.AbstractSession getSession()

logProfile

public void logProfile()
PUBLIC: Set whether after each query execution the profile result should be logged. Bu default this is true.


logProfileSummary

public void logProfileSummary()
PUBLIC: Log a profile summary.


logProfileSummaryByClass

public void logProfileSummaryByClass()
PUBLIC: Log a profile summary by class.


logProfileSummaryByQuery

public void logProfileSummaryByQuery()
PUBLIC: Log a profile summary by query.


profileExecutionOfQuery

public java.lang.Object profileExecutionOfQuery(DatabaseQuery query,
                                                Record row,
                                                org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Finish a profile operation if profiling. This assumes the start operation preceeds on the stack. The session must be passed to allow units of work etc. to share their parents profiler.

Specified by:
profileExecutionOfQuery in interface SessionProfiler
Returns:
the execution result of the query.

setNestLevel

protected void setNestLevel(int nestLevel)

setNestTime

protected void setNestTime(long nestTime)

setOperationStartTimes

protected void setOperationStartTimes(java.util.Hashtable operationStartTimes)

setOperationStartTimesByThread

protected void setOperationStartTimesByThread(java.util.Hashtable operationStartTimesByThread)

setOperationTimings

protected void setOperationTimings(java.util.Hashtable operationTimings)

setOperationTimingsByThread

protected void setOperationTimingsByThread(java.util.Hashtable operationTimingsByThread)

setProfiles

protected void setProfiles(java.util.Vector profiles)

setProfileTime

protected void setProfileTime(long profileTime)

setSession

public void setSession(Session session)
Description copied from interface: SessionProfiler
INTERNAL: Set the session.

Specified by:
setSession in interface SessionProfiler

setShouldLogProfile

public void setShouldLogProfile(boolean shouldLogProfile)
PUBLIC: Set whether after each query execution the profile result should be logged. Bu default this is true.


shouldLogProfile

public boolean shouldLogProfile()

startOperationProfile

public void startOperationProfile(java.lang.String operationName)
INTERNAL: Start the operation timing.

Specified by:
startOperationProfile in interface SessionProfiler

startOperationProfile

public void startOperationProfile(java.lang.String operationName,
                                  DatabaseQuery query,
                                  int weight)
INTERNAL: Start the operation timing.

Specified by:
startOperationProfile in interface SessionProfiler

writeNestingTabs

protected void writeNestingTabs(java.io.Writer writer)

update

public void update(java.lang.String operationName,
                   java.lang.Object value)
Description copied from interface: SessionProfiler
INTERNAL: Update the value of the State sensor.(DMS)

Specified by:
update in interface SessionProfiler

occurred

public void occurred(java.lang.String operationName)
Description copied from interface: SessionProfiler
INTERNAL: Increase DMS Event sensor occurrence.(DMS)

Specified by:
occurred in interface SessionProfiler

setProfileWeight

public void setProfileWeight(int weight)
Description copied from interface: SessionProfiler
INTERNAL: Set DMS sensor weight(DMS)

Specified by:
setProfileWeight in interface SessionProfiler

getProfileWeight

public int getProfileWeight()
Description copied from interface: SessionProfiler
INTERNAL: Return DMS sensor weight(DMS)

Specified by:
getProfileWeight in interface SessionProfiler

initialize

public void initialize()
Description copied from interface: SessionProfiler
INTERNAL: Initialize EclipseLink noun tree(DMS)

Specified by:
initialize in interface SessionProfiler

EclipseLink 1.1.1_ 1.1.1.v20090430-r4097 API Reference