Class PerformanceMonitor
java.lang.Object
org.eclipse.persistence.tools.profiler.PerformanceMonitor
- All Implemented Interfaces:
Serializable
,Cloneable
,SessionProfiler
Purpose: A tool used to provide performance monitoring information in a server environment.
- See Also:
- Author:
- James Sutherland
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected long
protected long
protected int
protected org.eclipse.persistence.internal.sessions.AbstractSession
protected static final String
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Log the results after a set amount of time has passed.clone()
void
Log the results to the session's log (System.out).void
endOperationProfile
(String operationName) INTERNAL: End the operation timing.void
endOperationProfile
(String operationName, DatabaseQuery query, int weight) INTERNAL: End the operation timing.long
Return the number of milliseconds after which the monitor results should be logged.getOperationTime
(String operation) int
Return the level of profiling.org.eclipse.persistence.internal.sessions.AbstractSession
void
INTERNAL: Initialize EclipseLink noun tree(DMS)void
INTERNAL: Increase DMS Event sensor occurrence.(DMS)void
occurred
(String operationName, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Increase DMS Event sensor occurrence.(DMS)profileExecutionOfQuery
(DatabaseQuery query, Record row, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Monitoring is done on the endOperation only.void
setDumpTime
(long dumpTime) Set the number of milliseconds after which the monitor results should be logged.void
setProfileWeight
(int profileWeight) Set the level of profiling.void
setSession
(Session session) INTERNAL: Set the session.void
startOperationProfile
(String operationName) INTERNAL: Start the operation timing.void
startOperationProfile
(String operationName, DatabaseQuery query, int weight) INTERNAL: Start the operation timing.void
INTERNAL: Update the value of the State sensor.(DMS)
-
Field Details
-
COUNTER
- See Also:
-
TIMER
- See Also:
-
session
protected transient org.eclipse.persistence.internal.sessions.AbstractSession session -
operationTimings
-
operationStartTimesByThread
-
lastDumpTime
protected long lastDumpTime -
dumpTime
protected long dumpTime -
profileWeight
protected int profileWeight
-
-
Constructor Details
-
PerformanceMonitor
public PerformanceMonitor()PUBLIC: Create a new profiler. The profiler can be registered with a session to log performance information on queries.
-
-
Method Details
-
getDumpTime
public long getDumpTime()Return the number of milliseconds after which the monitor results should be logged. -
setDumpTime
public void setDumpTime(long dumpTime) Set the number of milliseconds after which the monitor results should be logged. -
clone
-
checkDumpTime
public void checkDumpTime()Log the results after a set amount of time has passed. -
dumpResults
public void dumpResults()Log the results to the session's log (System.out). -
endOperationProfile
INTERNAL: End the operation timing.- Specified by:
endOperationProfile
in interfaceSessionProfiler
-
endOperationProfile
INTERNAL: End the operation timing.- Specified by:
endOperationProfile
in interfaceSessionProfiler
-
getOperationStartTimes
-
getOperationStartTimesByThread
-
getOperationTime
-
getOperationTimings
-
getSession
public org.eclipse.persistence.internal.sessions.AbstractSession getSession() -
profileExecutionOfQuery
public Object profileExecutionOfQuery(DatabaseQuery query, Record row, org.eclipse.persistence.internal.sessions.AbstractSession session) INTERNAL: Monitoring is done on the endOperation only.- Specified by:
profileExecutionOfQuery
in interfaceSessionProfiler
- Returns:
- the execution result of the query.
-
setSession
Description copied from interface:SessionProfiler
INTERNAL: Set the session.- Specified by:
setSession
in interfaceSessionProfiler
-
startOperationProfile
INTERNAL: Start the operation timing.- Specified by:
startOperationProfile
in interfaceSessionProfiler
-
startOperationProfile
INTERNAL: Start the operation timing.- Specified by:
startOperationProfile
in interfaceSessionProfiler
-
update
Description copied from interface:SessionProfiler
INTERNAL: Update the value of the State sensor.(DMS)- Specified by:
update
in interfaceSessionProfiler
-
occurred
public void occurred(String operationName, org.eclipse.persistence.internal.sessions.AbstractSession session) Description copied from interface:SessionProfiler
INTERNAL: Increase DMS Event sensor occurrence.(DMS)- Specified by:
occurred
in interfaceSessionProfiler
-
occurred
public void occurred(String operationName, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session) Description copied from interface:SessionProfiler
INTERNAL: Increase DMS Event sensor occurrence.(DMS)- Specified by:
occurred
in interfaceSessionProfiler
-
setProfileWeight
public void setProfileWeight(int profileWeight) Set the level of profiling. One of ALL, HEAVY, NORMAL, NONE. The higher the level, the more operations are profiled.- Specified by:
setProfileWeight
in interfaceSessionProfiler
- See Also:
-
getProfileWeight
public int getProfileWeight()Return the level of profiling. One of ALL, HEAVY, NORMAL, NONE.- Specified by:
getProfileWeight
in interfaceSessionProfiler
- See Also:
-
initialize
public void initialize()Description copied from interface:SessionProfiler
INTERNAL: Initialize EclipseLink noun tree(DMS)- Specified by:
initialize
in interfaceSessionProfiler
-