From d81c3e9a133724114ec21c27ed053194afc5aee2 Mon Sep 17 00:00:00 2001 From: Gerard Date: Wed, 1 Jul 2026 20:00:59 -0400 Subject: [PATCH] fix(perf): gzip+base64 TCP results through SSM (beat the ~24KB stdout cap) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Perf run 28552788420 produced real per-config result JSON, but retrieval via 'cat file' over SSM truncated it at ~24000 chars (AWS SSM StandardOutputContent cap) — every file was exactly 23984 bytes and ended mid-structure with '--output truncated--', so JSON parsing failed and all results were lost. Retrieve with 'gzip -c file | base64 -w0' between markers and decode locally. gzip shrinks the JSON ~15x (24KB sample -> ~1.6KB on the wire), far under the cap. Verified locally: marker-wrap -> extract -> base64 -d -> gunzip recovers the bytes exactly. Companion to the DpdkBackend::send_frame TX fix — both are needed for a green TCP perf run (that fix makes connections establish; this one delivers the resulting numbers intact). Co-Authored-By: Claude Opus 4.8 (1M context) --- scripts/run-perf-tests.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/scripts/run-perf-tests.sh b/scripts/run-perf-tests.sh index e0ac87c..70acdd2 100755 --- a/scripts/run-perf-tests.sh +++ b/scripts/run-perf-tests.sh @@ -1056,18 +1056,23 @@ ${output_tail} return 1 fi - # Download results. - local results_json - results_json=$(ssm_run_command "$TREX_INSTANCE_ID" 30 \ - "echo '---JSON_START---'; cat /tmp/perf-results/${config_name}.json 2>/dev/null || echo 'FILE_NOT_FOUND'") - if [[ "$results_json" == *"FILE_NOT_FOUND"* ]]; then + # Download results — gzip+base64 through SSM. The full TCP results JSON is + # larger than SSM's ~24KB StandardOutputContent cap, so a plain `cat` gets + # truncated mid-structure (invalid JSON, "--output truncated--"). gzip shrinks + # it ~15x — well under the cap — and base64 makes it safe to carry; we decode + # locally. + local results_b64 + results_b64=$(ssm_run_command "$TREX_INSTANCE_ID" 30 \ + "if [ -f /tmp/perf-results/${config_name}.json ]; then echo '---JSON_B64_START---'; gzip -c /tmp/perf-results/${config_name}.json | base64 -w0; echo; echo '---JSON_B64_END---'; else echo 'FILE_NOT_FOUND'; fi") + if [[ "$results_b64" == *"FILE_NOT_FOUND"* ]]; then log_error "TCP results file not found on TRex for $config_name" return 1 fi - local json_content - json_content=$(echo "$results_json" | sed -n '/^---JSON_START---$/,$ p' | tail -n +2) mkdir -p "$RESULTS_DIR" - echo "$json_content" > "$RESULTS_DIR/${config_name}.json" + echo "$results_b64" \ + | sed -n '/---JSON_B64_START---/,/---JSON_B64_END---/p' \ + | sed '1d;$d' | tr -d ' \t\r\n' \ + | base64 -d 2>/dev/null | gunzip 2>/dev/null > "$RESULTS_DIR/${config_name}.json" local json_check json_check=$(python3 -c "