Class DMSPerformanceProfiler
- java.lang.Object
-
- org.eclipse.persistence.tools.profiler.oracle.DMSPerformanceProfiler
-
- All Implemented Interfaces:
Serializable
,Cloneable
,SessionProfiler
public class DMSPerformanceProfiler extends Object implements Serializable, Cloneable, SessionProfiler
Purpose: Define the interface of EclipseLink profiler for using DMS gate.Description: A mechanism used to provide a link for EclipseLink performance profiling by using the DMS tool. The predefined EclipseLink metrics will be monitored by using DMS sensors. EclipseLink library instrumentation will be done by inserting DMS calls for the purpose of measuring its performance
Responsibilities:
- Define the EclipseLink metrics.
- Provide APIs to monitor the sensors at runtime.
- Change DMS sensor weight at runtime
- See Also:
- Serialized Form
- Since:
- TopLink 10.1.3
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,oracle.dms.instrument.Noun>
allWeightNouns
protected Map<String,oracle.dms.instrument.Sensor>
allWeightSensors
static String
CACHE
static String
CacheNounType
static String
CONNECT
static String
ConnectionInUse
static String
ConnectionNounType
static String
DistributedMergeDmsDisplayName
static String
EclipseLinkRootNoun
protected Map<String,oracle.dms.instrument.Noun>
heavyWeightNouns
protected Map<String,oracle.dms.instrument.Sensor>
heavyWeightSensors
protected static boolean
isDMSSpyInitialized
static String
MergeTime
static String
MiscellaneousNounType
protected Map<String,oracle.dms.instrument.Sensor>
normalAndHeavyWeightSensors
protected Map<String,oracle.dms.instrument.Sensor>
normalHeavyAndAllWeightSensors
protected Map<String,oracle.dms.instrument.Noun>
normalWeightNouns
protected Map<String,oracle.dms.instrument.Sensor>
normalWeightSensors
protected ThreadLocal
operationStartTokenThreadLocal
static String
RcmNounType
protected oracle.dms.instrument.Noun
root
static String
Sequencing
protected org.eclipse.persistence.internal.sessions.AbstractSession
session
static String
SessionNounType
static String
TransactionNounType
static String
UnitOfWorkRegister
protected int
weight
-
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 DMSPerformanceProfiler()
PUBLIC: Create a new dms profiler.DMSPerformanceProfiler(Session session)
PUBLIC: Create a new dms profiler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
createRootNoun()
INTERNAL: Create root noun for TopLink dms metrics.protected void
destroyNounsByWeight(int weight)
INTERNAL: Destroy nouns based on dms weight when user changes the weight at runtime.protected void
destroySensorsByWeight(int weight)
INTERNAL: Destroy sensors based on dms weight when user changes the weight at runtime.void
endOperationProfile(String operationName)
INTERNAL: Link to the dms PhaseEvent api stop().void
endOperationProfile(String operationName, DatabaseQuery query, int weight)
INTERNAL: Link to the dms PhaseEvent api stop().protected Map<String,oracle.dms.instrument.Noun>
getAllWeightNouns()
protected Map<String,oracle.dms.instrument.Sensor>
getAllWeightSensors()
protected Map<String,oracle.dms.instrument.Noun>
getHeavyWeightNouns()
protected Map<String,oracle.dms.instrument.Sensor>
getHeavyWeightSensors()
protected Map<String,oracle.dms.instrument.Sensor>
getNormalAndHeavyWeightSensors()
protected Map<String,oracle.dms.instrument.Sensor>
getNormalHeavyAndAllWeightSensors()
protected Map<String,oracle.dms.instrument.Noun>
getNormalWeightNouns()
protected Map<String,oracle.dms.instrument.Sensor>
getNormalWeightSensors()
protected oracle.dms.instrument.Noun
getNounByType(String type, oracle.dms.instrument.Noun parentNoun, int weight)
INTERNAL: Look for noun based on the given type and weight.protected ThreadLocal
getOperationStartTokenThreadLocal()
protected oracle.dms.instrument.Sensor
getPhaseEventForQuery(String operationName, DatabaseQuery query, int weight)
INTERNAL: Look for sensor for the name: TopLink_<sessionName>_<domainClass>_<queryClass>_<queryName>(if exist)_<operationName>(if exist).protected HashMap
getPhaseEventStartToken()
int
getProfileWeight()
INTERNAL: Return current TopLink dms weight.protected oracle.dms.instrument.Sensor
getSensorByName(String operationName)
INTERNAL: Return dms sensor which created by pre-defined TopLink metrics.org.eclipse.persistence.internal.sessions.AbstractSession
getSession()
String
getSessionName()
void
initialize()
INTERNAL: Initialize TopLink noun tree by default (DMSConsole.getSensorWeight())protected void
initializeAllWeightSensors()
INTERNAL: Build dms ALL weight sensors for TopLink dms metrics.protected void
initializeHeavyWeightSensors()
INTERNAL: Build dms HEAVY weight sensors for TopLink dms metrics.protected void
initializeNormalWeightSensors()
INTERNAL: Build dms NORMAL weight sensors for TopLink dms metrics.protected void
initializeNounTree(int newWeight)
INTERNAL: Initialize TopLink noun tree based on dms weight.protected void
initSpy()
INTERNAL: This method is useful for standalone TopLink application Initialize DMS, should be called once and should be called before any other DMS calls.void
occurred(String operationName, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Link to the dms Event api occurred().void
occurred(String operationName, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Increase DMS Event sensor occurrence.(DMS)Object
profileExecutionOfQuery(DatabaseQuery query, Record row, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Finish a profile operation if profiling.void
setProfileWeight(int newWeight)
INTERNAL: Api for changing dms weight dynamically.void
setSession(Session session)
INTERNAL: Set the session.void
startOperationProfile(String operationName)
INTERNAL: Link to the dms PhaseEvent api start().void
startOperationProfile(String operationName, DatabaseQuery query, int weight)
INTERNAL: Link to the dms PhaseEvent api start().void
update(String operationName, Object value)
INTERNAL: Link to the dms State api update().
-
-
-
Field Detail
-
EclipseLinkRootNoun
public static final String EclipseLinkRootNoun
- See Also:
- Constant Field Values
-
SessionNounType
public static final String SessionNounType
- See Also:
- Constant Field Values
-
TransactionNounType
public static final String TransactionNounType
- See Also:
- Constant Field Values
-
RcmNounType
public static final String RcmNounType
- See Also:
- Constant Field Values
-
ConnectionNounType
public static final String ConnectionNounType
- See Also:
- Constant Field Values
-
CacheNounType
public static final String CacheNounType
- See Also:
- Constant Field Values
-
MiscellaneousNounType
public static final String MiscellaneousNounType
- See Also:
- Constant Field Values
-
ConnectionInUse
public static final String ConnectionInUse
- See Also:
- Constant Field Values
-
MergeTime
public static final String MergeTime
- See Also:
- Constant Field Values
-
UnitOfWorkRegister
public static final String UnitOfWorkRegister
- See Also:
- Constant Field Values
-
DistributedMergeDmsDisplayName
public static final String DistributedMergeDmsDisplayName
- See Also:
- Constant Field Values
-
Sequencing
public static final String Sequencing
- See Also:
- Constant Field Values
-
CONNECT
public static final String CONNECT
- See Also:
- Constant Field Values
-
CACHE
public static final String CACHE
- See Also:
- Constant Field Values
-
session
protected org.eclipse.persistence.internal.sessions.AbstractSession session
-
root
protected oracle.dms.instrument.Noun root
-
normalAndHeavyWeightSensors
protected Map<String,oracle.dms.instrument.Sensor> normalAndHeavyWeightSensors
-
normalHeavyAndAllWeightSensors
protected Map<String,oracle.dms.instrument.Sensor> normalHeavyAndAllWeightSensors
-
operationStartTokenThreadLocal
protected ThreadLocal operationStartTokenThreadLocal
-
isDMSSpyInitialized
protected static boolean isDMSSpyInitialized
-
weight
protected int weight
-
-
Constructor Detail
-
DMSPerformanceProfiler
public DMSPerformanceProfiler()
PUBLIC: Create a new dms profiler. The profiler can be registered with a session to log performance information.
-
DMSPerformanceProfiler
public DMSPerformanceProfiler(Session session)
PUBLIC: Create a new dms profiler. The profiler can be registered with a session to log performance information.
-
-
Method Detail
-
initializeNounTree
protected void initializeNounTree(int newWeight)
INTERNAL: Initialize TopLink noun tree based on dms weight.
-
setProfileWeight
public void setProfileWeight(int newWeight)
INTERNAL: Api for changing dms weight dynamically.- Specified by:
setProfileWeight
in interfaceSessionProfiler
-
initialize
public void initialize()
INTERNAL: Initialize TopLink noun tree by default (DMSConsole.getSensorWeight())- Specified by:
initialize
in interfaceSessionProfiler
-
getProfileWeight
public int getProfileWeight()
INTERNAL: Return current TopLink dms weight.- Specified by:
getProfileWeight
in interfaceSessionProfiler
-
startOperationProfile
public void startOperationProfile(String operationName)
INTERNAL: Link to the dms PhaseEvent api start().- Specified by:
startOperationProfile
in interfaceSessionProfiler
-
startOperationProfile
public void startOperationProfile(String operationName, DatabaseQuery query, int weight)
INTERNAL: Link to the dms PhaseEvent api start(). Intended to be used for query profiling.- Specified by:
startOperationProfile
in interfaceSessionProfiler
-
endOperationProfile
public void endOperationProfile(String operationName)
INTERNAL: Link to the dms PhaseEvent api stop().- Specified by:
endOperationProfile
in interfaceSessionProfiler
-
endOperationProfile
public void endOperationProfile(String operationName, DatabaseQuery query, int weight)
INTERNAL: Link to the dms PhaseEvent api stop(). Intended to be used for query profiling.- Specified by:
endOperationProfile
in interfaceSessionProfiler
-
update
public void update(String operationName, Object value)
INTERNAL: Link to the dms State api update().- Specified by:
update
in interfaceSessionProfiler
-
occurred
public void occurred(String operationName, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Link to the dms Event api occurred().- Specified by:
occurred
in interfaceSessionProfiler
-
occurred
public void occurred(String operationName, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Increase DMS Event sensor occurrence.(DMS)- Specified by:
occurred
in interfaceSessionProfiler
-
getPhaseEventForQuery
protected oracle.dms.instrument.Sensor getPhaseEventForQuery(String operationName, DatabaseQuery query, int weight)
INTERNAL: Look for sensor for the name: TopLink_<sessionName>_<domainClass>_<queryClass>_<queryName>(if exist)_<operationName>(if exist). If not found, look for the noun the sensor should be built on. If the noun is not found, create a new one. Create the sensor based on the noun.
-
getNounByType
protected oracle.dms.instrument.Noun getNounByType(String type, oracle.dms.instrument.Noun parentNoun, int weight)
INTERNAL: Look for noun based on the given type and weight. If not found and the parent noun is not null, create a new noun.
-
getSensorByName
protected oracle.dms.instrument.Sensor getSensorByName(String operationName)
INTERNAL: Return dms sensor which created by pre-defined TopLink metrics.
-
createRootNoun
protected void createRootNoun()
INTERNAL: Create root noun for TopLink dms metrics.
-
initializeNormalWeightSensors
protected void initializeNormalWeightSensors()
INTERNAL: Build dms NORMAL weight sensors for TopLink dms metrics.
-
initializeHeavyWeightSensors
protected void initializeHeavyWeightSensors()
INTERNAL: Build dms HEAVY weight sensors for TopLink dms metrics.
-
initializeAllWeightSensors
protected void initializeAllWeightSensors()
INTERNAL: Build dms ALL weight sensors for TopLink dms metrics.
-
initSpy
protected void initSpy()
INTERNAL: This method is useful for standalone TopLink application Initialize DMS, should be called once and should be called before any other DMS calls.
-
destroySensorsByWeight
protected void destroySensorsByWeight(int weight)
INTERNAL: Destroy sensors based on dms weight when user changes the weight at runtime.
-
destroyNounsByWeight
protected void destroyNounsByWeight(int weight)
INTERNAL: Destroy nouns based on dms weight when user changes the weight at runtime.
-
getPhaseEventStartToken
protected HashMap getPhaseEventStartToken()
-
getNormalAndHeavyWeightSensors
protected Map<String,oracle.dms.instrument.Sensor> getNormalAndHeavyWeightSensors()
-
getNormalHeavyAndAllWeightSensors
protected Map<String,oracle.dms.instrument.Sensor> getNormalHeavyAndAllWeightSensors()
-
getOperationStartTokenThreadLocal
protected ThreadLocal getOperationStartTokenThreadLocal()
-
getSession
public org.eclipse.persistence.internal.sessions.AbstractSession getSession()
-
getSessionName
public String getSessionName()
-
setSession
public void setSession(Session session)
Description copied from interface:SessionProfiler
INTERNAL: Set the session.- Specified by:
setSession
in interfaceSessionProfiler
-
profileExecutionOfQuery
public Object profileExecutionOfQuery(DatabaseQuery query, Record row, org.eclipse.persistence.internal.sessions.AbstractSession session)
Description copied from interface:SessionProfiler
INTERNAL: Finish a profile operation if profiling. This assumes the start operation proceeds on the stack. The session must be passed to allow units of work etc. to share their parents profiler.- Specified by:
profileExecutionOfQuery
in interfaceSessionProfiler
- Returns:
- the execution result of the query.
-
-