Skip to main content
Jump to: navigation, search

EclipseLink/UserGuide/JPA/Advanced JPA Development/Performance/Performance Monitoring and Profiling/Performance Profiling

< EclipseLink‎ | UserGuide‎ | JPA‎ | Advanced JPA Development‎ | Performance‎ | Performance Monitoring and Profiling
Revision as of 06:38, 17 April 2013 by (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Warning This page is now obsolete.

For current information, please see "Monitoring and Optimizing EclipseLink-Enabled Applications" in the EclipseLink Solutions Guide:

EclipseLink JPA

Mailing ListForumsIRCmattermost
OpenHelp WantedBug Day
Browse Source

Performance Profiling

Measuring EclipseLink Performance with the EclipseLink Profiler

The most important challenge to performance tuning is knowing what to optimize. To improve the performance of your application, identify the areas of your application that do not operate at peak efficiency. The EclipseLink performance profiler helps you identify performance problems by logging performance statistics for every executed query in a given session.

Elug note icon.png

Note: You should also consider using general performance profilers such as JDeveloper or JProfiler to analyze performance problems. These tools can provide more detail that may be required to properly diagnose a problem.

The EclipseLink performance profiler logs the following information to the EclipseLink log file.]):

  • query class;
  • domain class;
  • total time, total execution time of the query, including any nested queries (in milliseconds);
  • local time, execution time of the query, excluding any nested queries (in milliseconds);
  • number of objects, the total number of objects affected;
  • number of objects handled per second;
  • logging, the amount of time spent printing logging messages (in milliseconds);
  • SQL prepare, the amount of time spent preparing the SQL script (in milliseconds);
  • SQL execute, the amount of time spent executing the SQL script (in milliseconds);
  • row fetch, the amount of time spent fetching rows from the database (in milliseconds);
  • cache, the amount of time spent searching or updating the object cache (in milliseconds);
  • object build, the amount of time spent building the domain object (in milliseconds);
  • query prepare, the amount of time spent to prepare the query prior to execution (in milliseconds);
  • SQL generation, the amount of time spent to generate the SQL script before it is sent to the database (in milliseconds).

Elug note icon.png

Note: Use the EclipseLink profiler to profile single-threaded finite use cases to determine the bottle neck.

Do not use the EclipseLink profiler to enable monitoring of a long-running multi-threaded server.

This section includes information on the following topics:

How to Configure the EclipseLink Performance Profiler

When using JPA the profiler can be set in your persistence.xml through the persistence property "eclipselink.profiler" to "PerformanceProfiler". See the ProfilerType in the config package for other profiling options.

The EclipseLink performance profiler is an instance of class. It provides the following public API:

  • logProfile – enables the profiler;
  • dontLogProfile – disables the profiler;
  • logProfileSummary – organizes the profiler log into a summary of all the individual operation profiles including operation statistics like the shortest time of all the operations that were profiled, the total time of all the operations, the number of objects returned by profiled queries, and the total time that was spent in each kind of operation that was profiled;
  • logProfileSummaryByQuery – organizes the profiler log into a summary of all the individual operation profiles by query;
  • logProfileSummaryByClass – organizes the profiler log into a summary of all the individual operation profiles by class.

How to Access the EclipseLink Profiler Results

The simplest way to view EclipseLink profiler results is to read the EclipseLink log files with a text editor. For general information about EclipseLink logging, such as logging file location]].

This example shows an example of the EclipseLink profiler output.

Performance Profiler Output

Begin Profile of{
Profile(ReadAllQuery,# of obj=12, time=139923809,sql execute=21723809,
prepare=49523809, row fetch=39023809, time/obj=11623809,obj/sec=8)
} End Profile

The second line of the profile contains the following information about a query:

  • ReadAllQuery(com.demos.employee.domain.Employee): specific query profiled, and its arguments.
  • Profile(ReadAllQuery: start of the profile and the type of query.
  • # of obj=12: number of objects involved in the query.
  • time=139923809: total execution time of the query (in milliseconds).
  • sql execute=21723809: total time spent executing the SQL statement.
  • prepare=49523809: total time spent preparing the SQL statement.
  • row fetch=39023809: total time spent fetching rows from the database.
  • time/obj=116123809: number of nanoseconds spent on each object.
  • obj/sec=8: number of objects handled per second.

Version: 2.2.0 DRAFT
Other versions...

Back to the top