|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
GroupedTimingStatistics | Represents a set of TimingStatistics calculated for a specific time period for a set of tags. |
LogParser | LogParser provides the main method for reading a log of StopWatch output and generating statistics and graphs from that output. |
StopWatch | The StopWatch class is the main object that is used to log timing statements in perf4j. |
TimingStatistics | TimingStatistics represent a set of statistical measures over a set of timing data, such as a collection of StopWatch instances. |
Perf4J is a performance logging and monitoring framework for Java. It allows developers to make simple timing calls around code blocks, and these timing statements can then be aggregated, analyzed and graphed by the Perf4J tools.
Here is a sample of how to integrate timing statements in code:
StopWatch
stopWatch = new StopWatch("tagName");
... some code ...
log.info(stopWatch.stop()); // perf4j lets you use the logging framework of your choice
To analyze the logged timing statements you run the log output file through the LogParser
,
which generates statistical aggregates like mean, standard deviation and transactions per second. Optionally, if you
are using the Log4J or java.util.logging frameworks, you can set up helper appenders or handlers which will perform
the real-time aggregation and graph generation for you (IMPORTANT java.util.logging support is not yet
available, to be completed in the next revision of perf4j). See the org.perf4j.log4j
and
org.perf4j.javalog
packages for more information.
In addition, many developers will find it most useful to use Perf4J's profiling annotations in the
org.perf4j.aop
package instead of inserting timing statements directly in code.
These annotations, together with an AOP framework like AspectJ or Spring AOP, allow developers to add timed blocks
without cluttering the main logic of the code.
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |