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

public Class PerformanceMonitor

extends Object
implements Serializable, Cloneable, SessionProfiler
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.sessions.SessionProfiler, java.lang.Cloneable, java.io.Serializable
Imports
java.text.NumberFormat, java.util.*, java.util.concurrent.ConcurrentHashMap, java.io.*, org.eclipse.persistence.queries.*, org.eclipse.persistence.sessions.DataRecord, .SessionProfiler, org.eclipse.persistence.internal.sessions.AbstractRecord, .AbstractSession

Purpose: A tool used to provide performance monitoring information in a server environment.

Author
James Sutherland
Since
EclipseLink 2.2

Field Summary

Modifier and TypeField and Description
protected static final String
protected long
protected long
protected Map<Integer, Map<String, Long>>
protected Map<String, Object>
protected int
protected transient AbstractSession
protected static final String

Constructor Summary

AccessConstructor and Description
public
PerformanceMonitor()

PUBLIC: Create a new profiler.

Method Summary

Modifier and TypeMethod and Description
public void
checkDumpTime()

Log the results after a set amount of time has passed.

public PerformanceMonitor
clone()

Overrides java.lang.Object.clone.

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

Log the results to the session's log (System.out).

public void
endOperationProfile(String operationName)

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

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

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

INTERNAL: End the operation timing.
public long
getDumpTime()

Return the number of milliseconds after which the monitor results should be logged.

protected Map<String, Long>
protected Map<Integer, Map<String, Long>>
public Object
public Map<String, Object>
public int
public AbstractSession
public void
initialize()

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

INTERNAL: Initialize EclipseLink noun tree(DMS)
public void
occurred(String operationName, AbstractSession session)

Implements org.eclipse.persistence.sessions.SessionProfiler.occurred.

INTERNAL: Increase DMS Event sensor occurrence.(DMS)
public void
occurred(String operationName, DatabaseQuery query, AbstractSession session)

Implements org.eclipse.persistence.sessions.SessionProfiler.occurred.

INTERNAL: Increase DMS Event sensor occurrence.(DMS)
public Object
profileExecutionOfQuery(DatabaseQuery query, DataRecord row, AbstractSession session)

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

INTERNAL: Monitoring is done on the endOperation only.
public void
setDumpTime(long dumpTime)

Set the number of milliseconds after which the monitor results should be logged.

public void
setProfileWeight(int profileWeight)

Implements org.eclipse.persistence.sessions.SessionProfiler.setProfileWeight.

Set the level of profiling.
public void
public void
startOperationProfile(String operationName)

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

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

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

INTERNAL: Start the operation timing.
public void
update(String operationName, Object value)

Implements org.eclipse.persistence.sessions.SessionProfiler.update.

INTERNAL: Update the value of the State sensor.(DMS)
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

COUNTERback to summary
protected static final String COUNTER
dumpTimeback to summary
protected long dumpTime
lastDumpTimeback to summary
protected long lastDumpTime
operationStartTimesByThreadback to summary
protected Map<Integer, Map<String, Long>> operationStartTimesByThread
operationTimingsback to summary
protected Map<String, Object> operationTimings
profileWeightback to summary
protected int profileWeight
sessionback to summary
protected transient AbstractSession session
TIMERback to summary
protected static final String TIMER

Constructor Detail

PerformanceMonitorback to summary
public PerformanceMonitor()

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

Method Detail

checkDumpTimeback to summary
public void checkDumpTime()

Log the results after a set amount of time has passed.

cloneback to summary
public PerformanceMonitor 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:PerformanceMonitor

a clone of this instance.

Annotations
@Override
dumpResultsback to summary
public void dumpResults()

Log the results to the session's log (System.out).

endOperationProfileback to summary
public void endOperationProfile(String operationName)

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)

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

INTERNAL: End the operation timing.

Annotations
@Override
getDumpTimeback to summary
public long getDumpTime()

Return the number of milliseconds after which the monitor results should be logged.

getOperationStartTimesback to summary
protected Map<String, Long> getOperationStartTimes()
getOperationStartTimesByThreadback to summary
protected Map<Integer, Map<String, Long>> getOperationStartTimesByThread()
getOperationTimeback to summary
public Object getOperationTime(String operation)
getOperationTimingsback to summary
public Map<String, Object> getOperationTimings()
getProfileWeightback to summary
public int getProfileWeight()

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

Return the level of profiling. One of ALL, HEAVY, NORMAL, NONE.

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

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

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

INTERNAL: Initialize EclipseLink noun tree(DMS)

Annotations
@Override
occurredback to summary
public void occurred(String operationName, AbstractSession session)

Implements org.eclipse.persistence.sessions.SessionProfiler.occurred.

Doc from org.eclipse.persistence.sessions.SessionProfiler.occurred.

INTERNAL: Increase DMS Event sensor occurrence.(DMS)

Annotations
@Override
occurredback to summary
public void occurred(String operationName, DatabaseQuery query, AbstractSession session)

Implements org.eclipse.persistence.sessions.SessionProfiler.occurred.

Doc from org.eclipse.persistence.sessions.SessionProfiler.occurred.

INTERNAL: Increase DMS Event sensor occurrence.(DMS)

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

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

INTERNAL: Monitoring is done on the endOperation only.

Returns:Object

Doc from org.eclipse.persistence.sessions.SessionProfiler.profileExecutionOfQuery.

the execution result of the query.

Annotations
@Override
setDumpTimeback to summary
public void setDumpTime(long dumpTime)

Set the number of milliseconds after which the monitor results should be logged.

setProfileWeightback to summary
public void setProfileWeight(int profileWeight)

Implements org.eclipse.persistence.sessions.SessionProfiler.setProfileWeight.

Set the level of profiling. One of ALL, HEAVY, NORMAL, NONE. The higher the level, the more operations are profiled.

Annotations
@Override
See Also
SessionProfiler
setSessionback to summary
public void setSession(Session session)

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

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

INTERNAL: Set the session.

Annotations
@Override
startOperationProfileback to summary
public void startOperationProfile(String operationName)

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)

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

INTERNAL: Start the operation timing.

Annotations
@Override
updateback to summary
public void update(String operationName, Object value)

Implements org.eclipse.persistence.sessions.SessionProfiler.update.

Doc from org.eclipse.persistence.sessions.SessionProfiler.update.

INTERNAL: Update the value of the State sensor.(DMS)

Annotations
@Override