Class PerformanceProfiler
java.lang.Object
org.eclipse.persistence.sessions.SessionProfilerAdapter
org.eclipse.persistence.tools.profiler.PerformanceProfiler
- All Implemented Interfaces:
Serializable,Cloneable,SessionProfiler
Purpose: A tool used to provide high level performance profiling information.
- See Also:
- Author:
- James Sutherland
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected longprotected longprotected org.eclipse.persistence.internal.sessions.AbstractSessionprotected booleanFields 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
ConstructorsConstructorDescriptionPUBLIC: Create a new profiler.PerformanceProfiler(boolean shouldLogProfile) PUBLIC: Create a new profiler. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddProfile(Profile profile) INTERNAL: Return a summary profile reporting on the profiles contained.INTERNAL: Return a map of summary profiles reporting on the profile contained.INTERNAL: Return a map of summary profiles reporting on the profile contained.clone()voidPUBLIC: Set whether after each query execution the profile result should be logged.voidendOperationProfile(String operationName) INTERNAL: End the operation timing.voidendOperationProfile(String operationName, DatabaseQuery query, int weight) INTERNAL: End the operation timing.protected intprotected longReturn the profiles logged in this profiler.protected longintINTERNAL: Return DMS sensor weight(DMS)org.eclipse.persistence.internal.sessions.AbstractSessionvoidINTERNAL: Initialize EclipseLink noun tree(DMS)voidPUBLIC: Set whether after each query execution the profile result should be logged.voidPUBLIC: Log a profile summary.voidPUBLIC: Log a profile summary by class.voidPUBLIC: Log a profile summary by query.profileExecutionOfQuery(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(Map<String, Long> operationStartTimes) protected voidsetOperationStartTimesByThread(Hashtable operationStartTimesByThread) protected voidsetOperationTimings(Map<String, Long> operationTimings) protected voidsetOperationTimingsByThread(Hashtable operationTimingsByThread) protected voidsetProfiles(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.booleanvoidstartOperationProfile(String operationName) INTERNAL: Start the operation timing.voidstartOperationProfile(String operationName, DatabaseQuery query, int weight) INTERNAL: Start the operation timing.protected voidwriteNestingTabs(Writer writer) Methods inherited from class org.eclipse.persistence.sessions.SessionProfilerAdapter
occurred, occurred, setProfileWeight, update
-
Field Details
-
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
-
operationStartTimesByThread
-
-
Constructor Details
-
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(boolean shouldLogProfile) PUBLIC: Create a new profiler. The profiler can be registered with a session to log performance information on queries.
-
-
Method Details
-
addProfile
-
buildProfileSummary
INTERNAL: Return a summary profile reporting on the profiles contained. -
buildProfileSummaryByClass
INTERNAL: Return a map of summary profiles reporting on the profile contained. -
buildProfileSummaryByQuery
INTERNAL: Return a map of summary profiles reporting on the profile contained. -
clone
-
dontLogProfile
public void dontLogProfile()PUBLIC: Set whether after each query execution the profile result should be logged. By default this is false. -
endOperationProfile
INTERNAL: End the operation timing.- Specified by:
endOperationProfilein interfaceSessionProfiler- Overrides:
endOperationProfilein classSessionProfilerAdapter
-
endOperationProfile
INTERNAL: End the operation timing.- Specified by:
endOperationProfilein interfaceSessionProfiler- Overrides:
endOperationProfilein classSessionProfilerAdapter
-
getNestLevel
protected int getNestLevel() -
getNestTime
protected long getNestTime() -
getOperationStartTimes
-
getOperationStartTimesByThread
-
getOperationTimings
-
getOperationTimingsByThread
-
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 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
-
setOperationStartTimesByThread
-
setOperationTimings
-
setOperationTimingsByThread
-
setProfiles
-
setProfileTime
protected void setProfileTime(long profileTime) -
setSession
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
INTERNAL: Start the operation timing.- Specified by:
startOperationProfilein interfaceSessionProfiler- Overrides:
startOperationProfilein classSessionProfilerAdapter
-
startOperationProfile
INTERNAL: Start the operation timing.- Specified by:
startOperationProfilein interfaceSessionProfiler- Overrides:
startOperationProfilein classSessionProfilerAdapter
-
writeNestingTabs
-
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
-