Adds spring-boot-startup-time/, the companion project for BLOG-618: a runnable Spring Boot 4.1.1 application on JDK 25 that installs BufferingApplicationStartup and FlightRecorderApplicationStartup behind a system property, and a /diag/startup endpoint that computes step self time -- the number /actuator/startup does not give you and the one that names the actual culprits. Captured under docs/output/: the step tree sorted both ways, the same startup as JFR events, a +5000-class experiment putting 0.11 ms per scanned class on the classpath scan tax, the silent truncation a 2048-step buffer performs, and JDK 25 AOT cache timings (6.93 s to 4.82 s). Post body and metadata live in post/. Moves the existing Actuator project into actuator-in-production/ so the repository holds one directory per article; the root README is now an index.
27 lines
897 B
Bash
Executable File
27 lines
897 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Start the application with the given comma-separated profiles and block until it answers.
|
|
# ./scripts/run.sh # defaults
|
|
# ./scripts/run.sh exposeall,open # every endpoint, no authentication
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
source scripts/env.sh
|
|
PROFILES="${1:-}"
|
|
LOG="${LOG:-/tmp/actuator-demo.log}"
|
|
|
|
scripts/stop.sh
|
|
|
|
ARGS=(-B -o org.springframework.boot:spring-boot-maven-plugin:run)
|
|
[ -n "$PROFILES" ] && ARGS+=("-Dspring-boot.run.profiles=$PROFILES")
|
|
|
|
setsid nohup "$MVN" "${ARGS[@]}" > "$LOG" 2>&1 < /dev/null &
|
|
|
|
READY_URL="${READY_URL:-http://127.0.0.1:${APP_PORT}/orders/count}"
|
|
for _ in $(seq 1 90); do
|
|
code=$(curl -s -o /dev/null -w '%{http_code}' -u ops:ops-password "$READY_URL" || true)
|
|
[ "$code" != "000" ] && [ -n "$code" ] && exit 0
|
|
sleep 2
|
|
done
|
|
echo "application did not start; tail of $LOG:" >&2
|
|
tail -40 "$LOG" >&2
|
|
exit 1
|