public class FilteredStackProfiler extends Profiler
Profiler
. The difference between the two is
that this class only counts samples whose stack trace contains an entry matching a particular
pattern.
This is useful for drilling down into particular regions of code within an application also busy doing other things; for example, a production HTTP API may have many endpoints, but you only want to know what one of them spends its time doing.
Constructor and Description |
---|
FilteredStackProfiler(int pollIntervalInMs,
java.util.function.Predicate<java.lang.StackTraceElement[]> filter)
Constructs a new profiler instance.
|
FilteredStackProfiler(int pollIntervalInMs,
java.lang.String pattern)
Constructs a new profiler instance.
|
FilteredStackProfiler(java.util.function.Predicate<java.lang.StackTraceElement[]> filter)
Constructs a new profiler instance.
|
FilteredStackProfiler(java.lang.String pattern)
Constructs a new profiler instance.
|
public FilteredStackProfiler(java.lang.String pattern)
#dump()
with a provided output stream to get the results to.pattern
- Only stack traces where the string representation of a
StackTraceElement
matches this regular expression will be counted.public FilteredStackProfiler(java.util.function.Predicate<java.lang.StackTraceElement[]> filter)
#dump()
with a provided output stream to get the results to.filter
- Only stack traces where the predicate returns true
will be includedpublic FilteredStackProfiler(int pollIntervalInMs, java.lang.String pattern)
#dump()
with a provided output stream to get the results to.pollIntervalInMs
- frequency to check running threadspattern
- Only stack traces where the string representation of a
StackTraceElement
matches this regular expression will be counted.public FilteredStackProfiler(int pollIntervalInMs, java.util.function.Predicate<java.lang.StackTraceElement[]> filter)
#dump()
with a provided output stream to get the results to.pollIntervalInMs
- frequency to check running threadsfilter
- Only stack traces where the predicate returns true
will be included