<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_09) on Thu Nov 02 11:46:42 EST 2006 -->
<TITLE>
AntPerformanceListener (Ant Contrib)
</TITLE>
<META NAME="keywords" CONTENT="net.sf.antcontrib.perf.AntPerformanceListener class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="AntPerformanceListener (Ant Contrib)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package
</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class
</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help
</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.StopWatch.html" title="class in net.sf.antcontrib.perf"><B>NEXT CLASS
</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?net/sf/antcontrib/perf/AntPerformanceListener.html" target="_top"><B>FRAMES
</B></A>
<A HREF="AntPerformanceListener.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
<A HREF="#nested_class_summary">NESTED
</A> |
FIELD
|
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
FIELD
|
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
net.sf.antcontrib.perf
</FONT>
<BR>
Class AntPerformanceListener
</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>net.sf.antcontrib.perf.AntPerformanceListener
</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:
</B> <DD>java.util.EventListener, org.apache.tools.ant.BuildListener
</DD>
</DL>
<HR>
<DL>
<DT><PRE>public class
<B>AntPerformanceListener
</B><DT>extends java.lang.Object
<DT>implements org.apache.tools.ant.BuildListener
</DL>
</PRE>
<P>
This BuildListener keeps track of the total time it takes for each target and
task to execute, then prints out the totals when the build is finished. This
can help pinpoint the areas where a build is taking a lot of time so
optimization efforts can focus where they'll do the most good. Execution times
are grouped by targets and tasks, and are sorted from fastest running to
slowest running.
Output can be saved to a file by setting a property in Ant. Set
"performance.log" to the name of a file. This can be set either on the
command line with the -D option (-Dperformance.log=/tmp/performance.log)
or in the build file itself (
<property name="performance.log"
location="/tmp/performance.log"/>).
<p>Developed for use with Antelope, migrated to ant-contrib Oct 2003.
<P>
<P>
<DL>
<DT><B>Version:
</B></DT>
<DD>$Revision: 1.5 $
</DD>
<DT><B>Author:
</B></DT>
<DD>Dale Anson, danson@germane-software.com
</DD>
</DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.StopWatch.html" title="class in net.sf.antcontrib.perf">AntPerformanceListener.StopWatch
</A></B></CODE>
<BR>
A stopwatch, useful for 'quick and dirty' performance testing.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> class
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.StopWatchComparator.html" title="class in net.sf.antcontrib.perf">AntPerformanceListener.StopWatchComparator
</A></B></CODE>
<BR>
Compares the total times for two StopWatches.
</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.html#AntPerformanceListener()">AntPerformanceListener
</A></B>()
</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary
</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.html#buildFinished(org.apache.tools.ant.BuildEvent)">buildFinished
</A></B>(org.apache.tools.ant.BuildEvent
be)
</CODE>
<BR>
Sorts and prints the results.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.html#buildStarted(org.apache.tools.ant.BuildEvent)">buildStarted
</A></B>(org.apache.tools.ant.BuildEvent
be)
</CODE>
<BR>
Starts a 'running total' stopwatch.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static
void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.html#main(java.lang.String[])">main
</A></B>(java.lang.String[]
args)
</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.html#messageLogged(org.apache.tools.ant.BuildEvent)">messageLogged
</A></B>(org.apache.tools.ant.BuildEvent
be)
</CODE>
<BR>
no-op
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.html#targetFinished(org.apache.tools.ant.BuildEvent)">targetFinished
</A></B>(org.apache.tools.ant.BuildEvent
be)
</CODE>
<BR>
Stop timing the given target.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.html#targetStarted(org.apache.tools.ant.BuildEvent)">targetStarted
</A></B>(org.apache.tools.ant.BuildEvent
be)
</CODE>
<BR>
Start timing the given target.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.html#taskFinished(org.apache.tools.ant.BuildEvent)">taskFinished
</A></B>(org.apache.tools.ant.BuildEvent
be)
</CODE>
<BR>
Stop timing the given task.
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void
</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.html#taskStarted(org.apache.tools.ant.BuildEvent)">taskStarted
</A></B>(org.apache.tools.ant.BuildEvent
be)
</CODE>
<BR>
Start timing the given task.
</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object
</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail
</B></FONT></TH>
</TR>
</TABLE>
<A NAME="AntPerformanceListener()"><!-- --></A><H3>
AntPerformanceListener
</H3>
<PRE>
public
<B>AntPerformanceListener
</B>()
</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail
</B></FONT></TH>
</TR>
</TABLE>
<A NAME="buildStarted(org.apache.tools.ant.BuildEvent)"><!-- --></A><H3>
buildStarted
</H3>
<PRE>
public void
<B>buildStarted
</B>(org.apache.tools.ant.BuildEvent
be)
</PRE>
<DL>
<DD>Starts a 'running total' stopwatch.
<P>
<DD><DL>
<DT><B>Specified by:
</B><DD><CODE>buildStarted
</CODE> in interface
<CODE>org.apache.tools.ant.BuildListener
</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="buildFinished(org.apache.tools.ant.BuildEvent)"><!-- --></A><H3>
buildFinished
</H3>
<PRE>
public void
<B>buildFinished
</B>(org.apache.tools.ant.BuildEvent
be)
</PRE>
<DL>
<DD>Sorts and prints the results.
<P>
<DD><DL>
<DT><B>Specified by:
</B><DD><CODE>buildFinished
</CODE> in interface
<CODE>org.apache.tools.ant.BuildListener
</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="targetStarted(org.apache.tools.ant.BuildEvent)"><!-- --></A><H3>
targetStarted
</H3>
<PRE>
public void
<B>targetStarted
</B>(org.apache.tools.ant.BuildEvent
be)
</PRE>
<DL>
<DD>Start timing the given target.
<P>
<DD><DL>
<DT><B>Specified by:
</B><DD><CODE>targetStarted
</CODE> in interface
<CODE>org.apache.tools.ant.BuildListener
</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="targetFinished(org.apache.tools.ant.BuildEvent)"><!-- --></A><H3>
targetFinished
</H3>
<PRE>
public void
<B>targetFinished
</B>(org.apache.tools.ant.BuildEvent
be)
</PRE>
<DL>
<DD>Stop timing the given target.
<P>
<DD><DL>
<DT><B>Specified by:
</B><DD><CODE>targetFinished
</CODE> in interface
<CODE>org.apache.tools.ant.BuildListener
</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="taskStarted(org.apache.tools.ant.BuildEvent)"><!-- --></A><H3>
taskStarted
</H3>
<PRE>
public void
<B>taskStarted
</B>(org.apache.tools.ant.BuildEvent
be)
</PRE>
<DL>
<DD>Start timing the given task.
<P>
<DD><DL>
<DT><B>Specified by:
</B><DD><CODE>taskStarted
</CODE> in interface
<CODE>org.apache.tools.ant.BuildListener
</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="taskFinished(org.apache.tools.ant.BuildEvent)"><!-- --></A><H3>
taskFinished
</H3>
<PRE>
public void
<B>taskFinished
</B>(org.apache.tools.ant.BuildEvent
be)
</PRE>
<DL>
<DD>Stop timing the given task.
<P>
<DD><DL>
<DT><B>Specified by:
</B><DD><CODE>taskFinished
</CODE> in interface
<CODE>org.apache.tools.ant.BuildListener
</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="messageLogged(org.apache.tools.ant.BuildEvent)"><!-- --></A><H3>
messageLogged
</H3>
<PRE>
public void
<B>messageLogged
</B>(org.apache.tools.ant.BuildEvent
be)
</PRE>
<DL>
<DD>no-op
<P>
<DD><DL>
<DT><B>Specified by:
</B><DD><CODE>messageLogged
</CODE> in interface
<CODE>org.apache.tools.ant.BuildListener
</CODE></DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="main(java.lang.String[])"><!-- --></A><H3>
main
</H3>
<PRE>
public static void
<B>main
</B>(java.lang.String[]
args)
</PRE>
<DL>
<DD><DL>
</DL>
</DD>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package
</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class
</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index
</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help
</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../../../net/sf/antcontrib/perf/AntPerformanceListener.StopWatch.html" title="class in net.sf.antcontrib.perf"><B>NEXT CLASS
</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?net/sf/antcontrib/perf/AntPerformanceListener.html" target="_top"><B>FRAMES
</B></A>
<A HREF="AntPerformanceListener.html" target="_top"><B>NO FRAMES
</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes
</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:
<A HREF="#nested_class_summary">NESTED
</A> |
FIELD
|
<A HREF="#constructor_summary">CONSTR
</A> |
<A HREF="#method_summary">METHOD
</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:
FIELD
|
<A HREF="#constructor_detail">CONSTR
</A> |
<A HREF="#method_detail">METHOD
</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>