Class PerformanceMonitor
- java.lang.Object
-
- org.eclipse.persistence.tools.profiler.PerformanceMonitor
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,SessionProfiler
public class PerformanceMonitor extends java.lang.Object implements java.io.Serializable, java.lang.Cloneable, SessionProfiler
Purpose: A tool used to provide performance monitoring information in a server environment.
- See Also:
- Serialized Form
- Author:
- James Sutherland
- Since:
- EclipseLink 2.2
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringCOUNTERprotected longdumpTimeprotected longlastDumpTimeprotected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>>operationStartTimesByThreadprotected java.util.Map<java.lang.String,java.lang.Object>operationTimingsprotected intprofileWeightprotected org.eclipse.persistence.internal.sessions.AbstractSessionsessionprotected static java.lang.StringTIMER-
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 PerformanceMonitor()PUBLIC: Create a new profiler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckDumpTime()Log the results after a set amount of time has passed.PerformanceMonitorclone()voiddumpResults()Log the results to the session's log (System.out).voidendOperationProfile(java.lang.String operationName)INTERNAL: End the operation timing.voidendOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)INTERNAL: End the operation timing.longgetDumpTime()Return the number of milliseconds after which the monitor results should be logged.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()java.lang.ObjectgetOperationTime(java.lang.String operation)java.util.Map<java.lang.String,java.lang.Object>getOperationTimings()intgetProfileWeight()Return the level of profiling.org.eclipse.persistence.internal.sessions.AbstractSessiongetSession()voidinitialize()INTERNAL: Initialize EclipseLink noun tree(DMS)voidoccurred(java.lang.String operationName, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Increase DMS Event sensor occurrence.voidoccurred(java.lang.String operationName, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Increase DMS Event sensor occurrence.java.lang.ObjectprofileExecutionOfQuery(DatabaseQuery query, Record row, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Monitoring is done on the endOperation only.voidsetDumpTime(long dumpTime)Set the number of milliseconds after which the monitor results should be logged.voidsetProfileWeight(int profileWeight)Set the level of profiling.voidsetSession(Session session)INTERNAL: Set the session.voidstartOperationProfile(java.lang.String operationName)INTERNAL: Start the operation timing.voidstartOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)INTERNAL: Start the operation timing.voidupdate(java.lang.String operationName, java.lang.Object value)INTERNAL: Update the value of the State sensor.
-
-
-
Field Detail
-
COUNTER
protected static final java.lang.String COUNTER
- See Also:
- Constant Field Values
-
TIMER
protected static final java.lang.String TIMER
- See Also:
- Constant Field Values
-
session
protected transient org.eclipse.persistence.internal.sessions.AbstractSession session
-
operationTimings
protected java.util.Map<java.lang.String,java.lang.Object> operationTimings
-
operationStartTimesByThread
protected java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>> operationStartTimesByThread
-
lastDumpTime
protected long lastDumpTime
-
dumpTime
protected long dumpTime
-
profileWeight
protected int profileWeight
-
-
Method Detail
-
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
public PerformanceMonitor clone()
- Overrides:
clonein classjava.lang.Object
-
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
public void endOperationProfile(java.lang.String operationName)
INTERNAL: End the operation timing.- Specified by:
endOperationProfilein interfaceSessionProfiler
-
endOperationProfile
public void endOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)INTERNAL: End the operation timing.- Specified by:
endOperationProfilein interfaceSessionProfiler
-
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()
-
getOperationTime
public java.lang.Object getOperationTime(java.lang.String operation)
-
getOperationTimings
public java.util.Map<java.lang.String,java.lang.Object> getOperationTimings()
-
getSession
public org.eclipse.persistence.internal.sessions.AbstractSession getSession()
-
profileExecutionOfQuery
public java.lang.Object profileExecutionOfQuery(DatabaseQuery query, Record row, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Monitoring is done on the endOperation only.- Specified by:
profileExecutionOfQueryin interfaceSessionProfiler- Returns:
- the execution result of the query.
-
setSession
public void setSession(Session session)
Description copied from interface:SessionProfilerINTERNAL: Set the session.- Specified by:
setSessionin interfaceSessionProfiler
-
startOperationProfile
public void startOperationProfile(java.lang.String operationName)
INTERNAL: Start the operation timing.- Specified by:
startOperationProfilein interfaceSessionProfiler
-
startOperationProfile
public void startOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)INTERNAL: Start the operation timing.- Specified by:
startOperationProfilein interfaceSessionProfiler
-
update
public void update(java.lang.String operationName, java.lang.Object value)Description copied from interface:SessionProfilerINTERNAL: Update the value of the State sensor.(DMS)- Specified by:
updatein interfaceSessionProfiler
-
occurred
public void occurred(java.lang.String operationName, org.eclipse.persistence.internal.sessions.AbstractSession session)Description copied from interface:SessionProfilerINTERNAL: Increase DMS Event sensor occurrence.(DMS)- Specified by:
occurredin interfaceSessionProfiler
-
occurred
public void occurred(java.lang.String operationName, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)Description copied from interface:SessionProfilerINTERNAL: Increase DMS Event sensor occurrence.(DMS)- Specified by:
occurredin 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:
setProfileWeightin interfaceSessionProfiler- See Also:
SessionProfiler
-
getProfileWeight
public int getProfileWeight()
Return the level of profiling. One of ALL, HEAVY, NORMAL, NONE.- Specified by:
getProfileWeightin interfaceSessionProfiler- See Also:
SessionProfiler
-
initialize
public void initialize()
Description copied from interface:SessionProfilerINTERNAL: Initialize EclipseLink noun tree(DMS)- Specified by:
initializein interfaceSessionProfiler
-
-