Use cases#
Pick the case closest to yours. Each says how to record, which root to use, and where to look.
A slow request on a server#
- Record with JDK Mission Control, and send the request while recording.
- Use the request entry point as the root, such as
org.springframework.web.servlet.DispatcherServlet::doDispatch. See Common roots. - Find the slowest request with
vbtm sessions rec.vbtm --sort dur, or in the flame chart.
Slow startup#
- Add
waitstart=60sto the agent, and use the startup method as the root, such asorg.springframework.boot.SpringApplication::run. - Start the application. It waits at
main()until you press Start recording in JDK Mission Control. - Follow the widest calls in the flame chart, or run
vbtm hot rec.vbtm.
A slow test#
- Record with the agent alone, set in Surefire's
argLineor Gradle'sjvmArgs. See Adding the agent. - Use
org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor::executeas the root. Each test method becomes one session. - Find the slowest tests with
vbtm sessions tests.vbtm --sort dur.
A batch job#
- Record with the agent alone, set in
JAVA_TOOL_OPTIONS. - Use the job's entry method as the root.
- Find where the time went with
vbtm hot job.vbtm.
Let an AI agent find the cause#
Record in any of the ways above, add the vbtm skill to your agent, and ask why it was slow.