feat: Phase 0 baseline benchmark script and log (WP-00) (#87) #95
3
.gitignore
vendored
3
.gitignore
vendored
@ -83,3 +83,6 @@ postgres_data/
|
||||
README_GAUNTLET_CLEANUP.md
|
||||
wipe_gauntlet_team.py
|
||||
SCHEMA.md
|
||||
|
||||
# Benchmark output files
|
||||
benchmarks/render_timings.txt
|
||||
|
||||
@ -70,8 +70,8 @@ echo "Elapsed: $(( (END - START) / 1000 )).$(( (END - START) % 1000 ))s"
|
||||
|
||||
| Environment | Cards | Elapsed (s) | Per-card avg (s) |
|
||||
|-------------|-------|-------------|-----------------|
|
||||
| dev | 20 | _TBD_ | _TBD_ |
|
||||
| dev | 20 | _TBD_ | _TBD_ |
|
||||
| dev (batting) | 20 | _TBD_ | _TBD_ |
|
||||
| dev (pitching) | 20 | _TBD_ | _TBD_ |
|
||||
|
||||
> **Note:** Run the upload command in the `card-creation` repo and record timings here.
|
||||
|
||||
|
||||
@ -48,13 +48,9 @@ TOTAL=0
|
||||
COUNT=0
|
||||
|
||||
|
|
||||
for player_id in "${PLAYER_IDS[@]}"; do
|
||||
URL="$API_BASE/api/v2/players/$player_id/${CARD_TYPE}card"
|
||||
# Bypass cached PNG files by adding ?nocache=1 (treated as unknown param, triggers re-render)
|
||||
# Remove this flag after baseline is captured to test cache-hit performance separately.
|
||||
HTTP_CODE=$(curl -s -o /dev/null \
|
||||
--write-out "%{http_code}" \
|
||||
-w " %{time_total}" \
|
||||
"$URL" 2>&1)
|
||||
# Bypass cached PNG files; remove ?nocache=1 after baseline is captured to test cache-hit performance.
|
||||
URL="$API_BASE/api/v2/players/$player_id/${CARD_TYPE}card?nocache=1"
|
||||
|
cal
commented
The The `2>&1` redirect here causes curl error messages to be captured in `$HTTP_CODE` rather than appearing on stderr. Since `curl -s` already suppresses progress output, the only thing `2>&1` captures is actual error text (e.g. connection refused). With `set -e` active, a curl failure will abort the script — but silently, because the error was swallowed. Remove `2>&1` so errors surface to the terminal.
|
||||
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code} %{time_total}" "$URL" 2>&1)
|
||||
STATUS=$(echo "$HTTP_CODE" | awk '{print $1}')
|
||||
TIMING=$(echo "$HTTP_CODE" | awk '{print $2}')
|
||||
echo " player_id=$player_id http=$STATUS time=${TIMING}s" | tee -a "$OUTFILE"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user
?nocache=1is almost certainly not in the nginxproxy_cache_keyand will be silently ignored, meaning this measures cache-hit latency (~ms) not full Playwright render time (~2-3s). Use the established cache-busting format instead:This matches the
?d={year}-{month}-{day}-{timestamp}convention from the card-creation codebase and guarantees a cache miss per request.