Add jfr-demo: JFR + Mission Control profiling of a live Spring Boot app
Custom OrderProcessed event, CPU/allocation/lock workloads, a diagnostic endpoint over the JVM's live FlightRecorder state, a JUnit test using the jdk.jfr.Recording API, and nine captured recordings (flagship, mid-flight snapshot, isolated vs concurrent threshold comparisons, and a real dump+stop duplication bug) with their docs/output/*.txt transcripts.
This commit is contained in:
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# Reproduces the main flagship recording: start a profile-settings recording,
|
||||
# drive real load, take a mid-flight snapshot to a DIFFERENT file (never the
|
||||
# recording's own destination -- see docs/output/09-dump-duplication-bug.txt
|
||||
# for what goes wrong if you do), then stop with its own filename.
|
||||
#
|
||||
# Usage: scripts/capture-jfr.sh <pid>
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.."
|
||||
PID="${1:?usage: capture-jfr.sh <pid>}"
|
||||
mkdir -p recordings
|
||||
|
||||
jcmd "$PID" JFR.start name=live settings=profile maxsize=256m
|
||||
|
||||
scripts/load.sh cpu
|
||||
scripts/load.sh alloc
|
||||
scripts/load.sh lock
|
||||
|
||||
jcmd "$PID" JFR.dump name=live filename="$(pwd)/recordings/mid-flight-snapshot.jfr"
|
||||
|
||||
scripts/load.sh orders
|
||||
|
||||
jcmd "$PID" JFR.stop name=live filename="$(pwd)/recordings/live-demo.jfr"
|
||||
|
||||
echo "wrote recordings/live-demo.jfr and recordings/mid-flight-snapshot.jfr"
|
||||
Reference in New Issue
Block a user