Class Profiler
java.lang.Object
edu.umd.cs.findbugs.log.Profiler
- All Implemented Interfaces:
IProfiler, XMLWriteable
This class is mutable and not synchronized, so create independent Profiler instance for each worker thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class(package private) static classstatic interfacestatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final booleanprivate final ConcurrentMap<Class<?>, Profiler.Profile> UsingConcurrentMapjust for historical reason.(package private) static final booleanprivate final Stack<Profiler.Clock> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the previously accumulated data.(package private) booleanvoidvoidendContext(Object context) private ObjectgetProfile(Class<?> c) (package private) Collection<Profiler.Profile> voidreport()Deprecated.voidreport(Comparator<Class<?>> reportComparator, Profiler.Filter filter, PrintStream stream) Deprecated.voidvoidstartContext(Object context) voidDeprecated.useProfileSummary.writeXML(XMLOutput)instead.
-
Field Details
-
REPORT
static final boolean REPORT -
MAX_CONTEXT
static final boolean MAX_CONTEXT -
startTimes
-
context
-
profile
Using
ConcurrentMapjust for historical reason. It can beMapbecause the Profiler class itself is not thread-safe.
-
-
Constructor Details
-
Profiler
public Profiler()The default constructor forProfiler.
-
-
Method Details
-
startContext
-
endContext
-
getContext
-
start
- Parameters:
c- The class of detector, analyzer or others that is NOT shared among worker threads.
-
end
- Parameters:
c- The class of detector, analyzer or others that is NOT shared among worker threads.
-
report
Deprecated.Default implementation usesProfiler.TotalTimeComparatorand prints out class statistics based on total time spent for a class -
report
@Deprecated public void report(Comparator<Class<?>> reportComparator, Profiler.Filter filter, 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 explicitly 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
- Specified by:
getProfilein interfaceIProfiler
-
writeXML
Deprecated.useProfileSummary.writeXML(XMLOutput)instead.Description copied from interface:XMLWriteableWrite this object to given XMLOutput.- Specified by:
writeXMLin interfaceXMLWriteable- Parameters:
xmlOutput- the XMLOutput for the document- Throws:
IOException
-
getTargetClasses
-
getProfiles
-
contains
-
ProfileSummary.report(Comparator, Predicate, PrintStream)instead.