Module org.eclipse.persistence.core
Class PerformanceMonitor
- java.lang.Object
-
- org.eclipse.persistence.tools.profiler.PerformanceMonitor
-
- All Implemented Interfaces:
Serializable,Cloneable,SessionProfiler
public class PerformanceMonitor extends Object implements Serializable, Cloneable, SessionProfiler
Purpose: A tool used to provide performance monitoring information in a server environment.
- Since:
- EclipseLink 2.2
- Author:
- James Sutherland
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringCOUNTERprotected longdumpTimeprotected longlastDumpTimeprotected Map<Integer,Map<String,Long>>operationStartTimesByThreadprotected Map<String,Object>operationTimingsprotected intprofileWeightprotected AbstractSessionsessionprotected static 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(String operationName)INTERNAL: End the operation timing.voidendOperationProfile(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 Map<String,Long>getOperationStartTimes()protected Map<Integer,Map<String,Long>>getOperationStartTimesByThread()ObjectgetOperationTime(String operation)Map<String,Object>getOperationTimings()intgetProfileWeight()Return the level of profiling.AbstractSessiongetSession()voidinitialize()INTERNAL: Initialize EclipseLink noun tree(DMS)voidoccurred(String operationName, AbstractSession session)INTERNAL: Increase DMS Event sensor occurrence.(DMS)voidoccurred(String operationName, DatabaseQuery query, AbstractSession session)INTERNAL: Increase DMS Event sensor occurrence.(DMS)ObjectprofileExecutionOfQuery(DatabaseQuery query, DataRecord row, 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(String operationName)INTERNAL: Start the operation timing.voidstartOperationProfile(String operationName, DatabaseQuery query, int weight)INTERNAL: Start the operation timing.voidupdate(String operationName, Object value)INTERNAL: Update the value of the State sensor.(DMS)
-
-
-
Field Detail
-
COUNTER
protected static final String COUNTER
- See Also:
- Constant Field Values
-
TIMER
protected static final String TIMER
- See Also:
- Constant Field Values
-
session
protected transient AbstractSession session
-
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()
-
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(String operationName)
INTERNAL: End the operation timing.- Specified by:
endOperationProfilein interfaceSessionProfiler
-
endOperationProfile
public void endOperationProfile(String operationName, DatabaseQuery query, int weight)
INTERNAL: End the operation timing.- Specified by:
endOperationProfilein interfaceSessionProfiler
-
getOperationStartTimesByThread
protected Map<Integer,Map<String,Long>> getOperationStartTimesByThread()
-
getSession
public AbstractSession getSession()
-
profileExecutionOfQuery
public Object profileExecutionOfQuery(DatabaseQuery query, DataRecord row, 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(String operationName)
INTERNAL: Start the operation timing.- Specified by:
startOperationProfilein interfaceSessionProfiler
-
startOperationProfile
public void startOperationProfile(String operationName, DatabaseQuery query, int weight)
INTERNAL: Start the operation timing.- Specified by:
startOperationProfilein interfaceSessionProfiler
-
update
public void update(String operationName, Object value)
Description copied from interface:SessionProfilerINTERNAL: Update the value of the State sensor.(DMS)- Specified by:
updatein interfaceSessionProfiler
-
occurred
public void occurred(String operationName, AbstractSession session)
Description copied from interface:SessionProfilerINTERNAL: Increase DMS Event sensor occurrence.(DMS)- Specified by:
occurredin interfaceSessionProfiler
-
occurred
public void occurred(String operationName, DatabaseQuery query, 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
-
-