File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,14 +36,18 @@ echo "Recording demo trace..."
3636cargo run --release -p metrics-service --bin metrics-service -- \
3737 --trace-path " $TRACE_PATH " --demo
3838
39- # Find the generated trace file (rotating writer appends an index).
40- TRACE_FILE=$( ls -1S $TRACE_GZ_GLOB 2> /dev/null | head -1)
41- if [ -z " $TRACE_FILE " ]; then
39+ # Concatenate all segments (sorted by index) into a single trace file.
40+ # When rotation occurs mid-run, early events (like TaskSpawn) end up in
41+ # earlier segments; concatenation preserves the complete timeline.
42+ # We decompress each segment and re-gzip as a single stream to avoid
43+ # multi-member gzip compatibility issues with older Node.js zlib.
44+ SEGMENTS=$( ls -1v $TRACE_GZ_GLOB 2> /dev/null)
45+ if [ -z " $SEGMENTS " ]; then
4246 echo " ERROR: No trace file generated" >&2
4347 exit 1
4448fi
4549
46- cp " $TRACE_FILE " " $DEMO_DEST "
50+ zcat $SEGMENTS | gzip > " $DEMO_DEST "
4751rm -f $TRACE_GZ_GLOB
4852
4953echo " Demo trace size:"
You can’t perform that action at this time.
0 commit comments