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...

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