EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.tools.profiler
Class PerformanceMonitor

java.lang.Object
  extended by 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
protected static java.lang.String COUNTER
           
protected  long dumpTime
           
protected  long lastDumpTime
           
protected  java.util.Map<java.lang.Integer,java.util.Map<java.lang.String,java.lang.Long>> operationStartTimesByThread
           
protected  java.util.Map<java.lang.String,java.lang.Object> operationTimings
           
protected  int profileWeight
           
protected  org.eclipse.persistence.internal.sessions.AbstractSession session
           
protected static java.lang.String TIMER
           
 
Fields inherited from interface org.eclipse.persistence.sessions.SessionProfiler
ALL, AssignSequence, CachedObjects, CacheHits, CacheMisses, Caching, ChangeSetsNotProcessed, ChangeSetsProcessed, ClientSessionCreated, ConnectionManagement, ConnectionPing, Connects, DescriptorEvent, Disconnects, DistributedMerge, HEAVY, JtsAfterCompletion, JtsBeforeCompletion, Logging, LoginTime, Merge, NONE, NORMAL, ObjectBuilding, OptimisticLockException, QueryPreparation, RcmReceived, RcmSent, RcmStatus, Register, RemoteChangeSet, RowFetch, SessionEvent, SessionName, SqlGeneration, SqlPrepare, StatementExecute, Transaction, UowCommit, UowCommits, UowCreated, UowRollbacks
 
Constructor Summary
PerformanceMonitor()
          PUBLIC: Create a new profiler.
 
Method Summary
 void checkDumpTime()
          Log the results after a set amount of time has passed.
 PerformanceMonitor clone()
           
 void dumpResults()
          Log the results to the session's log (System.out).
 void endOperationProfile(java.lang.String operationName)
          INTERNAL: End the operation timing.
 void endOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)
          INTERNAL: End the operation timing.
 long getDumpTime()
          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.Object getOperationTime(java.lang.String operation)
           
 java.util.Map<java.lang.String,java.lang.Object> getOperationTimings()
           
 int getProfileWeight()
          Return the level of profiling.
 org.eclipse.persistence.internal.sessions.AbstractSession getSession()
           
 void initialize()
          INTERNAL: Initialize EclipseLink noun tree(DMS)
 void occurred(java.lang.String operationName)
          INTERNAL: Increase DMS Event sensor occurrence.
 void occurred(java.lang.String operationName, DatabaseQuery query)
          INTERNAL: Increase DMS Event sensor occurrence.
 java.lang.Object 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(java.lang.String operationName)
          INTERNAL: Start the operation timing.
 void startOperationProfile(java.lang.String operationName, DatabaseQuery query, int weight)
          INTERNAL: Start the operation timing.
 void update(java.lang.String operationName, java.lang.Object value)
          INTERNAL: Update the value of the State sensor.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Constructor Detail

PerformanceMonitor

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

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:
clone in class java.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:
endOperationProfile in interface SessionProfiler

endOperationProfile

public void endOperationProfile(java.lang.String operationName,
                                DatabaseQuery query,
                                int weight)
INTERNAL: End the operation timing.

Specified by:
endOperationProfile in interface SessionProfiler

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:
profileExecutionOfQuery in interface SessionProfiler
Returns:
the execution result of the query.

setSession

public void setSession(Session session)
Description copied from interface: SessionProfiler
INTERNAL: Set the session.

Specified by:
setSession in interface SessionProfiler

startOperationProfile

public void startOperationProfile(java.lang.String operationName)
INTERNAL: Start the operation timing.

Specified by:
startOperationProfile in interface SessionProfiler

startOperationProfile

public void startOperationProfile(java.lang.String operationName,
                                  DatabaseQuery query,
                                  int weight)
INTERNAL: Start the operation timing.

Specified by:
startOperationProfile in interface SessionProfiler

update

public void update(java.lang.String operationName,
                   java.lang.Object value)
Description copied from interface: SessionProfiler
INTERNAL: Update the value of the State sensor.(DMS)

Specified by:
update in interface SessionProfiler

occurred

public void occurred(java.lang.String operationName)
Description copied from interface: SessionProfiler
INTERNAL: Increase DMS Event sensor occurrence.(DMS)

Specified by:
occurred in interface SessionProfiler

occurred

public void occurred(java.lang.String operationName,
                     DatabaseQuery query)
Description copied from interface: SessionProfiler
INTERNAL: Increase DMS Event sensor occurrence.(DMS)

Specified by:
occurred in interface SessionProfiler

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 interface SessionProfiler
See Also:
SessiobProfiler

getProfileWeight

public int getProfileWeight()
Return the level of profiling. One of ALL, HEAVY, NORMAL, NONE.

Specified by:
getProfileWeight in interface SessionProfiler
See Also:
SessiobProfiler

initialize

public void initialize()
Description copied from interface: SessionProfiler
INTERNAL: Initialize EclipseLink noun tree(DMS)

Specified by:
initialize in interface SessionProfiler

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference