Package edu.umd.cs.findbugs.log
Class Profiler
- java.lang.Object
-
- edu.umd.cs.findbugs.log.Profiler
-
- All Implemented Interfaces:
IProfiler
,XMLWriteable
@NotThreadSafe public class Profiler extends java.lang.Object implements IProfiler, XMLWriteable
This class is mutable and not synchronized, so create independent
Profiler
instance for each worker thread.- Author:
- pugh
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Profiler.ClassNameComparator
static interface
Profiler.Filter
static class
Profiler.FilterByCalls
static class
Profiler.FilterByTime
static class
Profiler.FilterByTimePerCall
static class
Profiler.Profile
static class
Profiler.TimePerCallComparator
static class
Profiler.TotalCallsComparator
static class
Profiler.TotalTimeComparator
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
clear()
Clears the previously accumulated data.void
end(java.lang.Class<?> c)
void
endContext(java.lang.Object context)
Profiler.Profile
getProfile(java.lang.Class<?> c)
void
report()
void
report(java.util.Comparator<java.lang.Class<?>> reportComparator, Profiler.Filter filter, java.io.PrintStream stream)
void
start(java.lang.Class<?> c)
void
startContext(java.lang.Object context)
void
writeXML(XMLOutput xmlOutput)
Deprecated.
-
-
-
Constructor Detail
-
Profiler
public Profiler()
The default constructor forProfiler
.
-
-
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)
- Parameters:
c
- The class of detector, analyzer or others that is NOT shared among worker threads.
-
end
public void end(java.lang.Class<?> c)
- Parameters:
c
- The class of detector, analyzer or others that is NOT shared among worker threads.
-
report
@Deprecated public void report()
Deprecated.Default implementation usesProfiler.TotalTimeComparator
and prints out class statistics based on total time spent fot a class
-
report
@Deprecated public void report(java.util.Comparator<java.lang.Class<?>> reportComparator, Profiler.Filter filter, java.io.PrintStream stream)
Deprecated.- 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)
- Specified by:
getProfile
in interfaceIProfiler
-
writeXML
@Deprecated public void writeXML(XMLOutput xmlOutput) throws java.io.IOException
Deprecated.Description copied from interface:XMLWriteable
Write this object to given XMLOutput.- Specified by:
writeXML
in interfaceXMLWriteable
- Parameters:
xmlOutput
- the XMLOutput for the document- Throws:
java.io.IOException
-
-