#!/usr/bin/env bash # A transcript of the service's own endpoints on JDK 27, so the post can show what a request and the # /memory report look like. Port 18081 is fixed so the transcript reads the same every time. source "$(dirname "$0")/lib.sh" PORT=18081 "$JDK27/bin/java" -Xms1g -Xmx1g -jar "$JAR" --server.port=$PORT >/dev/null 2>&1 & PID=$! for _ in $(seq 1 200); do curl -sf "localhost:$PORT/ping" >/dev/null 2>&1 && break; sleep 0.25; done for path in "/memory" "/load?n=2000000" "/memory" "/products/42" "/products/2000000"; do echo "\$ curl -s -w ' [HTTP %{http_code}]\n' localhost:$PORT$path" curl -s -w ' [HTTP %{http_code}]\n' "localhost:$PORT$path" | sed 's/^ \[HTTP/[HTTP/' echo done kill $PID 2>/dev/null; wait $PID 2>/dev/null exit 0