Package edu.umd.cs.findbugs.log
Class Profiler
- java.lang.Object
-
- edu.umd.cs.findbugs.log.Profiler
-
- All Implemented Interfaces:
XMLWriteable
public class Profiler extends java.lang.Object implements XMLWriteable
- Author:
- pugh
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProfiler.ClassNameComparatorstatic interfaceProfiler.Filterstatic classProfiler.FilterByCallsstatic classProfiler.FilterByTimestatic classProfiler.FilterByTimePerCallstatic classProfiler.Profilestatic classProfiler.TimePerCallComparatorstatic classProfiler.TotalCallsComparatorstatic classProfiler.TotalTimeComparator
-
Constructor Summary
Constructors Constructor Description Profiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears the previously accumulated data.voidend(java.lang.Class<?> c)voidendContext(java.lang.Object context)Profiler.ProfilegetProfile(java.lang.Class<?> c)voidreport()Default implementation usesProfiler.TotalTimeComparatorand prints out class statistics based on total time spent fot a classvoidreport(java.util.Comparator<java.lang.Class<?>> reportComparator, Profiler.Filter filter, java.io.PrintStream stream)voidstart(java.lang.Class<?> c)voidstartContext(java.lang.Object context)voidwriteXML(XMLOutput xmlOutput)Write this object to given XMLOutput.
-
-
-
Method Detail
-
startContext
public void startContext(java.lang.Object context)
-
endContext
public void endContext(java.lang.Object context)
-
start
public void start(java.lang.Class<?> c)
-
end
public void end(java.lang.Class<?> c)
-
report
public void report()
Default implementation usesProfiler.TotalTimeComparatorand prints out class statistics based on total time spent fot a class
-
report
public void report(java.util.Comparator<java.lang.Class<?>> reportComparator, Profiler.Filter filter, java.io.PrintStream stream)- Parameters:
reportComparator- non null comparator instance which will be used to sort the report statistics
-
clear
public void clear()
Clears the previously accumulated data. This method is public because it can be accessed explicitely from clients (like Eclipse).There is no need to clear profiler data after each run, because a new profiler instance is used for each analysis run (see
FindBugs2.execute()).
-
getProfile
public Profiler.Profile getProfile(java.lang.Class<?> c)
-
writeXML
public void writeXML(XMLOutput xmlOutput) throws java.io.IOException
Description copied from interface:XMLWriteableWrite this object to given XMLOutput.- Specified by:
writeXMLin interfaceXMLWriteable- Parameters:
xmlOutput- the XMLOutput for the document- Throws:
java.io.IOException
-
-