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
Modifier and TypeFieldDescriptionprotected int
protected long
protected long
protected org.eclipse.persistence.internal.sessions.AbstractSession
protected boolean
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
ConstructorDescriptionPUBLIC: Create a new profiler.PerformanceProfiler
(boolean shouldLogProfile) PUBLIC: Create a new profiler. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addProfile
(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()
void
PUBLIC: Set whether after each query execution the profile result should be logged.void
endOperationProfile
(String operationName) INTERNAL: End the operation timing.void
endOperationProfile
(String operationName, DatabaseQuery query, int weight) INTERNAL: End the operation timing.protected int
protected long
Return the profiles logged in this profiler.protected long
int
INTERNAL: Return DMS sensor weight(DMS)org.eclipse.persistence.internal.sessions.AbstractSession
void
INTERNAL: Initialize EclipseLink noun tree(DMS)void
PUBLIC: Set whether after each query execution the profile result should be logged.void
PUBLIC: Log a profile summary.void
PUBLIC: Log a profile summary by class.void
PUBLIC: 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 void
setNestLevel
(int nestLevel) protected void
setNestTime
(long nestTime) protected void
setOperationStartTimes
(Map<String, Long> operationStartTimes) protected void
setOperationStartTimesByThread
(Hashtable operationStartTimesByThread) protected void
setOperationTimings
(Map<String, Long> operationTimings) protected void
setOperationTimingsByThread
(Hashtable operationTimingsByThread) protected void
setProfiles
(Vector profiles) protected void
setProfileTime
(long profileTime) 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
void
startOperationProfile
(String operationName) INTERNAL: Start the operation timing.void
startOperationProfile
(String operationName, DatabaseQuery query, int weight) INTERNAL: Start the operation timing.protected void
writeNestingTabs
(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:
endOperationProfile
in interfaceSessionProfiler
- Overrides:
endOperationProfile
in classSessionProfilerAdapter
-
endOperationProfile
INTERNAL: End the operation timing.- Specified by:
endOperationProfile
in interfaceSessionProfiler
- Overrides:
endOperationProfile
in 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:
profileExecutionOfQuery
in interfaceSessionProfiler
- Overrides:
profileExecutionOfQuery
in 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:SessionProfilerAdapter
INTERNAL: Set the session.- Specified by:
setSession
in interfaceSessionProfiler
- Overrides:
setSession
in 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:
startOperationProfile
in interfaceSessionProfiler
- Overrides:
startOperationProfile
in classSessionProfilerAdapter
-
startOperationProfile
INTERNAL: Start the operation timing.- Specified by:
startOperationProfile
in interfaceSessionProfiler
- Overrides:
startOperationProfile
in classSessionProfilerAdapter
-
writeNestingTabs
-
getProfileWeight
public int getProfileWeight()Description copied from class:SessionProfilerAdapter
INTERNAL: Return DMS sensor weight(DMS)- Specified by:
getProfileWeight
in interfaceSessionProfiler
- Overrides:
getProfileWeight
in classSessionProfilerAdapter
-
initialize
public void initialize()Description copied from class:SessionProfilerAdapter
INTERNAL: Initialize EclipseLink noun tree(DMS)- Specified by:
initialize
in interfaceSessionProfiler
- Overrides:
initialize
in classSessionProfilerAdapter
-