BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Article: Performance Analysis and Monitoring with Perf4J

Article: Performance Analysis and Monitoring with Perf4J

Bookmarks

In this article Alex Devine explains how Java developers can take advantage of Perf4J, an open source toolset for adding code timing statements and for logging, analyzing and monitoring the results.

In today's world of service-oriented architectures and widely distributed applications, detecting the component responsible for a performance bottleneck can be exceedingly difficult:

Consider what happens on the server in the relatively common scenario of a typical web 2.0-style application:

  1. An incoming web request is dispatched to the component responsible for generating the response.
  2. The request may need to be authenticated against an LDAP server.
  3. The controller component makes queries against a database.
  4. The controller component also makes calls to a third-party web service.
  5. The controller component aggregates all of the retrieved data into a set of business objects for display.
  6. The business objects are rendered and the response is sent to the user's browser.
  7. AJAX code running in the browser causes additional requests to be sent back to the server

Perf4J is an open source toolset for adding Java server-side code timing statements and for logging, analyzing and monitoring the results. As Alex notes:

For those developers who are familiar with logging frameworks such as log4j or java.util.logging, an analogy helps to describe Perf4J:

Perf4J is to System.currentTimeMillis() as log4j is to System.out.println()

Read the full article: Performance Analysis and Monitoring with Perf4J

Rate this Article

Adoption
Style

BT