Package org.threadly.util.debug
Class StackTracker
- java.lang.Object
-
- org.threadly.util.debug.StackTracker
-
public class StackTracker extends java.lang.Object
This thread safe class allows you to record stacks in the code so that you can understand HOW something is being called. This is similar toProfiler
except there is no threading concept. Instead it is focused on the stack traces only and can be accessed concurrently.
-
-
Constructor Summary
Constructors Constructor Description StackTracker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Pair<java.lang.StackTraceElement[],java.lang.Long>>
dumpStackCounts()
Check how many unique stack traces have been recorded.void
recordStack()
Record the current stack into the internally monitored traces.void
reset()
Reset all stored data to allow a new capture.
-
-
-
Method Detail
-
recordStack
public void recordStack()
Record the current stack into the internally monitored traces. The call intoStackTracker
wont be included in the resulting stack.
-
dumpStackCounts
public java.util.List<Pair<java.lang.StackTraceElement[],java.lang.Long>> dumpStackCounts()
Check how many unique stack traces have been recorded.- Returns:
- A list with all the stack traces, de-duplicated, with the counts they were witnessed.
-
reset
public void reset()
Reset all stored data to allow a new capture.
-
-