You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
This is a tool to trace the execution of java methods. It is not optimised and may have a detrimental effect onapplication performance. Therefore, it is dangerous to use in production.
Build from source
Create a shadow jar by running the following command.
./gradlew installShadowDist
This will create a fat jar file underbuild/install/jstacktrace-shadow/lib/jstacktrace-all.jar. Copy it somewhereconvenient.
Usage
Before tracing, we must create a filter specification file to describe which methods to trace.This file should contain lines in the format described below.
To attach to a Gradle test, we can use JVM args like above. Edit our the relevantbuild.gradle and configure the test section to pass in our-javaagent JVM arg.
test { jvmArgs'-javaagent:path/to/jstacktrace-all.jar=<FILTER-SPEC-FILE>|<OUTPUT-DIR>'}
Output
Attaching to a process using any of the methods above should write a trace of method calls of each thread to its own file under the output directory. For example: