Skip to content

Commit e5166eb

Browse files
committed
fix(ci): concatenate all trace segments in demo regeneration
1 parent 8bee1d6 commit e5166eb

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

dial9-viewer/ui/demo-trace.bin

1.69 MB
Binary file not shown.

scripts/regenerate_demo_trace.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,18 @@ echo "Recording demo trace..."
3636
cargo 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
4448
fi
4549

46-
cp "$TRACE_FILE" "$DEMO_DEST"
50+
zcat $SEGMENTS | gzip > "$DEMO_DEST"
4751
rm -f $TRACE_GZ_GLOB
4852

4953
echo "Demo trace size:"

0 commit comments

Comments
 (0)