Skip to content

Conversation

@smklein
Copy link
Collaborator

@smklein smklein commented Dec 5, 2025

This is the last step of bundle collection: turn all bundle collection steps into a perfetto-formatted trace file, and stash it in "meta/trace.json".

The cost here is small, and this allows us to easily inspect bundle collection time.

Example output, visualized at ui.perfetto.dev:

image

Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice, this rocks!

Comment on lines 1091 to 1109
json!({
"name": step.name,
"cat": "bundle_collection",
"ph": "X", // Complete event (has duration)
"ts": start_us,
"dur": duration_us,
"pid": 1,
"tid": step_id,
"args": {
"status": step.status.to_string(),
}
})
})
.collect();

let trace_json = json!({
"traceEvents": trace_events,
"displayTimeUnit": "ms",
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a blocker but: i wonder if we might at some point want a struct deriving serde::Serialize for this, perhaps not in the support bundle collector module, so that we can emit similar Perfetto traces for other operations...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started with pulling this into a sub-module that's local to support bundles in 4714a78 - but happy to pull this out more broadly as a follow-up?

(I'm gonna probably break up this support bundle code into some smaller modules in a follow-up PR)

Base automatically changed from simplify-report to main December 8, 2025 17:59
@smklein smklein merged commit 8ef60d1 into main Dec 11, 2025
16 checks passed
@smklein smklein deleted the trace-bundle branch December 11, 2025 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants