Jump to: navigation, search

Difference between revisions of "EclipseLink/Examples/JPA/Monitoring"

(New page: Monitoring EclipseLink supports a profiling and monitoring API through its [http://www.eclipse.org/eclipselink/api/2.2/org/eclipse/persistence/session...)
 
Line 15: Line 15:
  
 
==Monitoring Levels==
 
==Monitoring Levels==
 
+
The profile weight can be configured for the PerformanceMonitor through the API.  The default weight if the PerformanceMonitor is set is <code>ALL</code>.
 +
By default no profiler is set for a persistence unit, so no profiling or monitoring is done.
 +
The higher the level of monitoring the larger the performance overhead of the monitor.
  
 
{| border="1" cellpadding="5"
 
{| border="1" cellpadding="5"
Line 21: Line 23:
 
! Level !! Description
 
! Level !! Description
 
|-  
 
|-  
| OFF
+
| NONE
| This setting disables the generation of the log output. You may want to set logging to OFF during production to avoid the overhead of logging.
+
| No monitoring is done.
 
|-  
 
|-  
|    SEVERE
+
|    NORMAL
|    This level enables reporting of failure cases only. Usually, if the failure occurs, the application stops.
+
|    Metrics are tracked, but profiling is not done.
 
|-  
 
|-  
|    WARNING
+
|    HEAVY
|    This level enables logging of issues that have a potential to cause problems. For example, a setting that is picked by the application and not by the user.
+
|    Metrics and profiling times are tracked.
 
|-  
 
|-  
|    INFO
+
|    ALL
|    This level enables the standard output. The contents of this output is very limited.  It is the default logging level if a logging level is not set.  
+
|    Metrics and profiling times are tracked.  
 
|-  
 
|-  
|    CONFIG
 
|    This level enables logging of such configuration details as your database login information and some metadata information. You may want to use the CONFIG log level at deployment time.
 
|-
 
|    FINE
 
|    This level enables logging of the first level of the debugging information and SQL. You may want to use this log level during debugging and testing, but not at production.
 
|-
 
|    FINER
 
|    This level enables logging of more debugging information than the FINE setting. For example, the transaction information is logged at this level. You may want to use this log level during debugging and testing, but not at production.
 
|-
 
|    FINEST
 
|    This level enables logging of more debugging information than the FINER setting, such as a very detailed information about certain features (for example, sequencing). You may want to use this log level during debugging and testing, but not at production.
 
|-
 
|    ALL
 
|    This level currently logs at the same level as FINEST. 
 
 
|}
 
|}

Revision as of 11:45, 26 January 2011


EclipseLink supports a profiling and monitoring API through its SessionProfiler interface. This interface gives events that allows a profiler or monitoring service to record performance or metrics on the EclipseLink application.

As of EclipseLink 2.2 a PerformanceMonitor is provided to collect performance an metric information. When enabled the PerformanceMonitor will log the monitoring information at set intervals, allowing an application's performance to be analyzed.

Previous to EclipseLink 2.2, a PerformanceProfiler was provided, but it did not make use of the complete SessionProfiler API, and was only useful for profiling a single use case, not a multi-user server. A QueryMonitor was also provided that provided simple monitoring information on queries, but no detailed information.

The PerformanceMonitor is enabled through the "eclipselink.profiler" persistence unit property in the persistence.xml file.

Persistence unit property

<property name="eclipselink.profiler" value="PerformanceMonitor"/>

Monitoring Levels

The profile weight can be configured for the PerformanceMonitor through the API. The default weight if the PerformanceMonitor is set is ALL. By default no profiler is set for a persistence unit, so no profiling or monitoring is done. The higher the level of monitoring the larger the performance overhead of the monitor.

Level Description
NONE No monitoring is done.
NORMAL Metrics are tracked, but profiling is not done.
HEAVY Metrics and profiling times are tracked.
ALL Metrics and profiling times are tracked.