h1. Fetch Statistics
|
Open JPA Fetch Statistics Tool monitors persistent field access and determines which fields are never used. This tool can be used to help tune an application.
|
The OpenJPA Fetch Statistics Tool (FST) monitors persistent field access and helps determine which fields in an application are not used. This tool is a development / test time tool that can help a developer properly tune an application.
|
|
h32. Note
|
|
* Open JPA Fetch Statistics Tool works with the runtime enhancement.
|
* Currently, FST only works with runtime enhancement (javaagent or in JEE container hook).
|
|
* Only the The persistent fields which satisfy all the following conditions will be tracked by the tool: :
|
** The field has EAGER fetch mode. ** The field is not primary key. ** The field is not defined as a version field.
|
h2. Download
|
|
h3. Download
|
The latest OpenJPA Tools JAR file can be download from the [SNAPSHOT Repository|https://repository.apache.org/content/groups/snapshots/org/apache/openjpa/openjpa-fetch-statistics/] or can be built from the source code in [svn|https://svn.apache.org/repos/asf/openjpa/trunk/openjpa-tools/openjpa-fetch-statistics/] by using Maven 2.2.1 and Java SE 6.
|
|
The latest OpenJPA Tools JAR file can be download from the [SNAPSHOT Repository|https://repository.apache.org/content/groups/snapshots/org/apache/openjpa/openjpa-fetch-statistics/] or can be built from the source code in [svn|https://svn.apache.org/repos/asf/openjpa/trunk/openjpa-tools/] by using Maven 2.2.1 and Java SE 6.
|
h2. Configuration * JSE - Append the path of openjpa-fetch-statistics-version-SNAPSHOT.jar file to the classpath prior to lanuching the JVM. * [Websphere Application Server|For Websphere Application Server]
|
|
h3. Usage
|
h3. Statistics Collecting and Monitoring {warning:title=Performance Consideration} There will be a large performance impact when running this tooling. It is not supported, nor recommended for production use. This tool should not be used on a production machine. {warning} * When this tool is configured, it will be active for all persistence units in the JVM. Statistics will be dumped via the openjpa.Runtime channel with the INFO level every 10 minutes, or when the JVM terminates.
|
|
h6. For Regular JVM
|
{info:title=Example output} \[7/13/12 9:05:44:265 CDT\] 00000072 Runtime I CWWJP9990I: openjpa.Runtime: Info: Successfully collected fetch statistics from Entities \[org.apache.openjpa.test.Address\]. The following fields are FetchType.EAGER and were never fetched [ total 7 ] : org.apache.openjpa.test.Address.city org.apache.openjpa.test.Address.country org.apache.openjpa.test.Address.phone org.apache.openjpa.test.Address.state org.apache.openjpa.test.Address.street1 org.apache.openjpa.test.Address.street2 org.apache.openjpa.test.Address.zip {info}
|
|
* Configuration Append the path of openjpa-fetch-statistics-version-SNAPSHOT.jar file to the classpath prior to lanuching the JVM. * Statistics Collecting and Monitoring When this tool is configured, it will be active for all persistence units in the JVM. Statistics will be dumped via the openjpa.Runtime channel with the INFO level every 10 minutes, or when the JVM terminates. Any EAGER field that is logged has not been accessed by an application.
|
* h2. Configuration removal
|
Stop the JVM. Remove openjpa-fetch-statistics-version-SNAPSHOT.jar from the classpath. h6. [For Websphere Application Server] h3. Performance Consideration There will be a large performance impact when running this tooling. It is not supported, nor recommended for production use. This tool should not be used on a production machine.
|
* Stop the JVM and reverse the steps completed to configure the tool.
|