Top Description Fields Constructors Methods
org.eclipse.persistence.tools.profiler

public Class PerformanceProfiler

extends SessionProfilerAdapter
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Imports
java.io.IOException, .Serializable, .Writer, java.util.Collection, .Enumeration, .Hashtable, .List, .Map, .Vector, org.eclipse.persistence.internal.helper.Helper, org.eclipse.persistence.internal.localization.ToStringLocalization, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession, org.eclipse.persistence.queries.DatabaseQuery, org.eclipse.persistence.sessions.DataRecord, .SessionProfilerAdapter

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

Author
James Sutherland
Since
TopLink 1.0

Field Summary

Modifier and TypeField and Description
protected int
protected long
protected Map<Integer, Map<String, Long>>
protected Map<Integer, Map<String, Long>>
protected List<Profile>
protected long
protected transient AbstractSession
protected boolean

Constructor Summary

AccessConstructor and Description
public
PerformanceProfiler()

PUBLIC: Create a new profiler.

public
PerformanceProfiler(boolean shouldLogProfile)

PUBLIC: Create a new profiler.

Method Summary

Modifier and TypeMethod and Description
protected void
public Profile
buildProfileSummary()

INTERNAL: Return a summary profile reporting on the profiles contained.

public Hashtable<Class<?>, Profile>
buildProfileSummaryByClass()

INTERNAL: Return a map of summary profiles reporting on the profile contained.

public Hashtable<Class<?>, Profile>
buildProfileSummaryByQuery()

INTERNAL: Return a map of summary profiles reporting on the profile contained.

public PerformanceProfiler
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public void
dontLogProfile()

PUBLIC: Set whether after each query execution the profile result should be logged.

public void
public void
protected int
protected long
protected Map<String, Long>
protected Map<Integer, Map<String, Long>>
protected Map<String, Long>
protected Map<Integer, Map<String, Long>>
public List<Profile>
getProfiles()

Return the profiles logged in this profiler.

protected long
public int
public AbstractSession
public void
public void
logProfile()

PUBLIC: Set whether after each query execution the profile result should be logged.

public void
logProfileSummary()

PUBLIC: Log a profile summary.

public void
logProfileSummaryByClass()

PUBLIC: Log a profile summary by class.

public void
logProfileSummaryByQuery()

PUBLIC: Log a profile summary by query.

public Object

Returns:

the execution result of the query.
profileExecutionOfQuery
(DatabaseQuery query, DataRecord row, AbstractSession session)

Overrides org.eclipse.persistence.sessions.SessionProfilerAdapter.profileExecutionOfQuery.

Implements org.eclipse.persistence.sessions.SessionProfiler.profileExecutionOfQuery.

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(Map<Integer, Map<String, Long>> operationStartTimesByThread)

protected void
setOperationTimings(Map<String, Long> operationTimings)

protected void
setOperationTimingsByThread(Map<Integer, Map<String, Long>> operationTimingsByThread)

protected void
protected void
setProfileTime(long profileTime)

public void
public void
setShouldLogProfile(boolean shouldLogProfile)

PUBLIC: Set whether after each query execution the profile result should be logged.

public boolean
public void
public void
protected void
Inherited from org.eclipse.persistence.sessions.SessionProfilerAdapter:
occurredoccurredsetProfileWeightupdate

Field Detail

nestLevelback to summary
protected int nestLevel
nestTimeback to summary
protected long nestTime
operationStartTimesByThreadback to summary
protected Map<Integer, Map<String, Long>> operationStartTimesByThread
operationTimingsByThreadback to summary
protected Map<Integer, Map<String, Long>> operationTimingsByThread
profilesback to summary
protected List<Profile> profiles
profileTimeback to summary
protected long profileTime
sessionback to summary
protected transient AbstractSession session
shouldLogProfileback to summary
protected boolean shouldLogProfile

Constructor Detail

PerformanceProfilerback to summary
public PerformanceProfiler()

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

PerformanceProfilerback to summary
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

addProfileback to summary
protected void addProfile(Profile profile)
buildProfileSummaryback to summary
public Profile buildProfileSummary()

INTERNAL: Return a summary profile reporting on the profiles contained.

buildProfileSummaryByClassback to summary
public Hashtable<Class<?>, Profile> buildProfileSummaryByClass()

INTERNAL: Return a map of summary profiles reporting on the profile contained.

buildProfileSummaryByQueryback to summary
public Hashtable<Class<?>, Profile> buildProfileSummaryByQuery()

INTERNAL: Return a map of summary profiles reporting on the profile contained.

cloneback to summary
public PerformanceProfiler clone()

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:PerformanceProfiler

a clone of this instance.

Annotations
@Override
dontLogProfileback to summary
public void dontLogProfile()

PUBLIC: Set whether after each query execution the profile result should be logged. By default this is false.

endOperationProfileback to summary
public void endOperationProfile(String operationName)

Overrides org.eclipse.persistence.sessions.SessionProfilerAdapter.endOperationProfile.

Implements org.eclipse.persistence.sessions.SessionProfiler.endOperationProfile.

INTERNAL: End the operation timing.

Annotations
@Override
endOperationProfileback to summary
public void endOperationProfile(String operationName, DatabaseQuery query, int weight)

Overrides org.eclipse.persistence.sessions.SessionProfilerAdapter.endOperationProfile.

Implements org.eclipse.persistence.sessions.SessionProfiler.endOperationProfile.

INTERNAL: End the operation timing.

Annotations
@Override
getNestLevelback to summary
protected int getNestLevel()
getNestTimeback to summary
protected long getNestTime()
getOperationStartTimesback to summary
protected Map<String, Long> getOperationStartTimes()
getOperationStartTimesByThreadback to summary
protected Map<Integer, Map<String, Long>> getOperationStartTimesByThread()
getOperationTimingsback to summary
protected Map<String, Long> getOperationTimings()
getOperationTimingsByThreadback to summary
protected Map<Integer, Map<String, Long>> getOperationTimingsByThread()
getProfilesback to summary
public List<Profile> getProfiles()

Return the profiles logged in this profiler.

getProfileTimeback to summary
protected long getProfileTime()
getProfileWeightback to summary
public int getProfileWeight()

Overrides org.eclipse.persistence.sessions.SessionProfilerAdapter.getProfileWeight.

Implements org.eclipse.persistence.sessions.SessionProfiler.getProfileWeight.

Doc from org.eclipse.persistence.sessions.SessionProfilerAdapter.getProfileWeight.

INTERNAL: Return DMS sensor weight(DMS)

Annotations
@Override
getSessionback to summary
public AbstractSession getSession()
initializeback to summary
public void initialize()

Overrides org.eclipse.persistence.sessions.SessionProfilerAdapter.initialize.

Implements org.eclipse.persistence.sessions.SessionProfiler.initialize.

Doc from org.eclipse.persistence.sessions.SessionProfilerAdapter.initialize.

INTERNAL: Initialize EclipseLink noun tree(DMS)

Annotations
@Override
logProfileback to summary
public void logProfile()

PUBLIC: Set whether after each query execution the profile result should be logged. By default this is true.

logProfileSummaryback to summary
public void logProfileSummary()

PUBLIC: Log a profile summary.

logProfileSummaryByClassback to summary
public void logProfileSummaryByClass()

PUBLIC: Log a profile summary by class.

logProfileSummaryByQueryback to summary
public void logProfileSummaryByQuery()

PUBLIC: Log a profile summary by query.

profileExecutionOfQueryback to summary
public Object profileExecutionOfQuery(DatabaseQuery query, DataRecord row, AbstractSession session)

Overrides org.eclipse.persistence.sessions.SessionProfilerAdapter.profileExecutionOfQuery.

Implements org.eclipse.persistence.sessions.SessionProfiler.profileExecutionOfQuery.

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.

Returns:Object

the execution result of the query.

Annotations
@Override
@SuppressWarnings:unchecked
setNestLevelback to summary
protected void setNestLevel(int nestLevel)
setNestTimeback to summary
protected void setNestTime(long nestTime)
setOperationStartTimesback to summary
protected void setOperationStartTimes(Map<String, Long> operationStartTimes)
setOperationStartTimesByThreadback to summary
protected void setOperationStartTimesByThread(Map<Integer, Map<String, Long>> operationStartTimesByThread)
setOperationTimingsback to summary
protected void setOperationTimings(Map<String, Long> operationTimings)
setOperationTimingsByThreadback to summary
protected void setOperationTimingsByThread(Map<Integer, Map<String, Long>> operationTimingsByThread)
setProfilesback to summary
protected void setProfiles(Vector<Profile> profiles)
setProfileTimeback to summary
protected void setProfileTime(long profileTime)
setSessionback to summary
public void setSession(Session session)

Overrides org.eclipse.persistence.sessions.SessionProfilerAdapter.setSession.

Implements org.eclipse.persistence.sessions.SessionProfiler.setSession.

Doc from org.eclipse.persistence.sessions.SessionProfilerAdapter.setSession.

INTERNAL: Set the session.

Annotations
@Override
setShouldLogProfileback to summary
public void setShouldLogProfile(boolean shouldLogProfile)

PUBLIC: Set whether after each query execution the profile result should be logged. By default this is true.

shouldLogProfileback to summary
public boolean shouldLogProfile()
startOperationProfileback to summary
public void startOperationProfile(String operationName)

Overrides org.eclipse.persistence.sessions.SessionProfilerAdapter.startOperationProfile.

Implements org.eclipse.persistence.sessions.SessionProfiler.startOperationProfile.

INTERNAL: Start the operation timing.

Annotations
@Override
startOperationProfileback to summary
public void startOperationProfile(String operationName, DatabaseQuery query, int weight)

Overrides org.eclipse.persistence.sessions.SessionProfilerAdapter.startOperationProfile.

Implements org.eclipse.persistence.sessions.SessionProfiler.startOperationProfile.

INTERNAL: Start the operation timing.

Annotations
@Override
writeNestingTabsback to summary
protected void writeNestingTabs(Writer writer)