Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Fetch Statistics

Open JPA The OpenJPA Fetch Statistics Tool (FST) monitors persistent field access and determines helps determine which fields in an application are never not used. This tool
can be used to help is a development / test time tool that can help a developer properly tune an application.

Note

  • Open JPA Fetch Statistics Tool Currently, FST only works with the 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

      ...

        • is fetched eagerly.

      ...

        • The field is not a primary key.

      ...

        • The field is not defined as a version field.

      Download

      The latest OpenJPA Tools JAR FST jar file can be download from the SNAPSHOT Repository or can be built from the source code in svn by using Maven 2.2.1 and Java SE 6.

      ...

      Configuration

      ...

      • JSE - Append the path of openjpa-fetch-statistics-version-SNAPSHOT.jar file to the classpath prior to lanuching the JVM.
      • Websphere Application Server
      • OSGi – ?? – Probably need another module that creates a proper bundle.

      Statistics Collecting and Monitoring

      ...

      Warning
      titlePerformance 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.

      • 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

      ...

      • .
      Info
      titleExample 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

      Configuration removal

      • Stop the JVM and reverse the steps completed to configure the tool
      • Configuration removal

                Stop the JVM.
                Remove openjpa-fetch-statistics-version-SNAPSHOT.jar from the classpath.

      Performance Consideration

      ...

      • .