|
||||||||||
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. |
LoggingStopWatch | A LoggingStopWatch prevents the need to explicitly send the StopWatch string to a Logger when stopping. |
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 used to time code blocks in Perf4J. |
TimedCallable<V> | This helper wrapper class can be used to add timing statements to an existing Callable instance, logging how long it takes for the call method to execute. |
TimedRunnable | This helper wrapper class can be used to add timing statements to an existing Runnable instance, logging how long it takes for the run method to execute. |
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:
// Note in the line below you usually want to instantiate a StopWatch that corresponds // to the logging framework of your choice, like aTo analyze the logged timing statements you run the log output file through theLog4JStopWatch
or anSlf4JStopWatch
.StopWatch
stopWatch = newLoggingStopWatch
("tagName"); ... some code ... stopWatch.stop(); // perf4j lets you use the logging framework of your choice
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 custom java.util.logging Handlers are 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 |