Class PerformanceProfiler
- java.lang.Object
-
- org.eclipse.persistence.sessions.SessionProfilerAdapter
-
- org.eclipse.persistence.tools.profiler.PerformanceProfiler
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,SessionProfiler
public class PerformanceProfiler extends SessionProfilerAdapter implements java.io.Serializable, java.lang.Cloneable
Purpose: A tool used to provide high level performance profiling information.
- See Also:
- Serialized Form
- Author:
- James Sutherland
- Since:
- TopLink 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected intnestLevelprotected longnestTimeprotected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>>operationStartTimesByThreadprotected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>>operationTimingsByThreadprotected java.util.List<Profile>profilesprotected longprofileTimeprotected org.eclipse.persistence.internal.sessions.AbstractSessionsessionprotected booleanshouldLogProfile-
Fields inherited from interface org.eclipse.persistence.sessions.SessionProfiler
ALL, AssignSequence, CacheCoordination, CacheCoordinationSerialize, CacheHits, CacheMisses, CacheSize, Caching, ChangeSetsNotProcessed, ChangeSetsProcessed, ClientSessionCreated, ClientSessionReleased, ConnectionManagement, ConnectionPing, Connects, DescriptorEvent, Disconnects, DistributedMerge, HEAVY, JtsAfterCompletion, JtsBeforeCompletion, Logging, LoginTime, Merge, NONE, NORMAL, ObjectBuilding, OptimisticLockException, QueryPreparation, RcmReceived, RcmSent, RcmStatus, Register, Remote, RemoteChangeSet, RemoteLazy, RemoteMetadata, RowFetch, SessionEvent, SessionName, SqlGeneration, SqlPrepare, StatementExecute, Transaction, UowCommit, UowCommits, UowCreated, UowReleased, UowRollbacks
-
-
Constructor Summary
Constructors Constructor Description PerformanceProfiler()PUBLIC: Create a new profiler.PerformanceProfiler(boolean shouldLogProfile)PUBLIC: Create a new profiler.PerformanceProfiler(Session session)Deprecated.replaced by PerformanceProfiler()PerformanceProfiler(Session session, boolean shouldLogProfile)Deprecated.replaced by PerformanceProfiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddProfile(Profile profile)ProfilebuildProfileSummary()INTERNAL: Return a summary profile reporting on the profiles contained.java.util.HashtablebuildProfileSummaryByClass()INTERNAL: Return a map of summary profiles reporting on the profile contained.java.util.HashtablebuildProfileSummaryByQuery()INTERNAL: Return a map of summary profiles reporting on the profile contained.PerformanceProfilerclone()voiddontLogProfile()PUBLIC: Set whether after each query execution the profile result should be logged.voidendOperationProfile(java.lang.String operationName)INTERNAL: End the operation timing.voidendOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)INTERNAL: End the operation timing.protected intgetNestLevel()protected longgetNestTime()protected java.util.Map<java.lang.String,java.lang.Long>getOperationStartTimes()protected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>>getOperationStartTimesByThread()protected java.util.Map<java.lang.String,java.lang.Long>getOperationTimings()protected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>>getOperationTimingsByThread()java.util.List<Profile>getProfiles()Return the profiles logged in this profiler.protected longgetProfileTime()intgetProfileWeight()INTERNAL: Return DMS sensor weight(DMS)org.eclipse.persistence.internal.sessions.AbstractSessiongetSession()voidinitialize()INTERNAL: Initialize EclipseLink noun tree(DMS)voidlogProfile()PUBLIC: Set whether after each query execution the profile result should be logged.voidlogProfileSummary()PUBLIC: Log a profile summary.voidlogProfileSummaryByClass()PUBLIC: Log a profile summary by class.voidlogProfileSummaryByQuery()PUBLIC: Log a profile summary by query.java.lang.ObjectprofileExecutionOfQuery(DatabaseQuery query, Record row, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Finish a profile operation if profiling.protected voidsetNestLevel(int nestLevel)protected voidsetNestTime(long nestTime)protected voidsetOperationStartTimes(java.util.Map<java.lang.String,java.lang.Long> operationStartTimes)protected voidsetOperationStartTimesByThread(java.util.Hashtable operationStartTimesByThread)protected voidsetOperationTimings(java.util.Map<java.lang.String,java.lang.Long> operationTimings)protected voidsetOperationTimingsByThread(java.util.Hashtable operationTimingsByThread)protected voidsetProfiles(java.util.Vector profiles)protected voidsetProfileTime(long profileTime)voidsetSession(Session session)INTERNAL: Set the session.voidsetShouldLogProfile(boolean shouldLogProfile)PUBLIC: Set whether after each query execution the profile result should be logged.booleanshouldLogProfile()voidstartOperationProfile(java.lang.String operationName)INTERNAL: Start the operation timing.voidstartOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)INTERNAL: Start the operation timing.protected voidwriteNestingTabs(java.io.Writer writer)-
Methods inherited from class org.eclipse.persistence.sessions.SessionProfilerAdapter
occurred, occurred, setProfileWeight, update
-
-
-
-
Field Detail
-
profiles
protected java.util.List<Profile> 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
-
operationTimingsByThread
protected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>> operationTimingsByThread
-
operationStartTimesByThread
protected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>> 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)
Deprecated.replaced by PerformanceProfiler()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)
Deprecated.replaced by PerformanceProfiler()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 PerformanceProfiler clone()
- Overrides:
clonein classjava.lang.Object
-
dontLogProfile
public void dontLogProfile()
PUBLIC: Set whether after each query execution the profile result should be logged. By default this is false.
-
endOperationProfile
public void endOperationProfile(java.lang.String operationName)
INTERNAL: End the operation timing.- Specified by:
endOperationProfilein interfaceSessionProfiler- Overrides:
endOperationProfilein classSessionProfilerAdapter
-
endOperationProfile
public void endOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)INTERNAL: End the operation timing.- Specified by:
endOperationProfilein interfaceSessionProfiler- Overrides:
endOperationProfilein classSessionProfilerAdapter
-
getNestLevel
protected int getNestLevel()
-
getNestTime
protected long getNestTime()
-
getOperationStartTimes
protected java.util.Map<java.lang.String,java.lang.Long> getOperationStartTimes()
-
getOperationStartTimesByThread
protected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>> getOperationStartTimesByThread()
-
getOperationTimings
protected java.util.Map<java.lang.String,java.lang.Long> getOperationTimings()
-
getOperationTimingsByThread
protected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>> getOperationTimingsByThread()
-
getProfiles
public java.util.List<Profile> 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. By 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 proceeds on the stack. The session must be passed to allow units of work etc. to share their parents profiler.- Specified by:
profileExecutionOfQueryin interfaceSessionProfiler- Overrides:
profileExecutionOfQueryin classSessionProfilerAdapter- 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.Map<java.lang.String,java.lang.Long> operationStartTimes)
-
setOperationStartTimesByThread
protected void setOperationStartTimesByThread(java.util.Hashtable operationStartTimesByThread)
-
setOperationTimings
protected void setOperationTimings(java.util.Map<java.lang.String,java.lang.Long> 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 class:SessionProfilerAdapterINTERNAL: Set the session.- Specified by:
setSessionin interfaceSessionProfiler- Overrides:
setSessionin classSessionProfilerAdapter
-
setShouldLogProfile
public void setShouldLogProfile(boolean shouldLogProfile)
PUBLIC: Set whether after each query execution the profile result should be logged. By default this is true.
-
shouldLogProfile
public boolean shouldLogProfile()
-
startOperationProfile
public void startOperationProfile(java.lang.String operationName)
INTERNAL: Start the operation timing.- Specified by:
startOperationProfilein interfaceSessionProfiler- Overrides:
startOperationProfilein classSessionProfilerAdapter
-
startOperationProfile
public void startOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)INTERNAL: Start the operation timing.- Specified by:
startOperationProfilein interfaceSessionProfiler- Overrides:
startOperationProfilein classSessionProfilerAdapter
-
writeNestingTabs
protected void writeNestingTabs(java.io.Writer writer)
-
getProfileWeight
public int getProfileWeight()
Description copied from class:SessionProfilerAdapterINTERNAL: Return DMS sensor weight(DMS)- Specified by:
getProfileWeightin interfaceSessionProfiler- Overrides:
getProfileWeightin classSessionProfilerAdapter
-
initialize
public void initialize()
Description copied from class:SessionProfilerAdapterINTERNAL: Initialize EclipseLink noun tree(DMS)- Specified by:
initializein interfaceSessionProfiler- Overrides:
initializein classSessionProfilerAdapter
-
-