Sample global trace concurrency across span ranges (#99254)
## Summary Show how much traced work was happening concurrently throughout a selected span. The trace server divides its range into up to 200 equal-duration segments and returns the time-weighted average number of active global self-time intervals per segment as `concurrencySamples` in the WebSocket query result. It traverses the self-time tree once and rounds averages to hundredths. **Depends on [#99233](https://github.com/vercel/next.js/pull/99233)** and targets its branch so this PR only adds derived concurrency samples. The matching [trace-viewer PR](https://github.com/vercel/turbo-trace-viewer/pull/36) graphs the new values. ## Verification - `cargo test --locked -p turbopack-trace-server` (28 library and 27 binary tests pass) - `cargo check --locked -p next-napi-bindings` - Local native build, `pnpm build-all`, and traced `bench/heavy-npm-deps` Turbopack build passed. The generated 272 MB trace contained 851,901 spans and showed nonzero concurrency for the selected top-level span in the updated viewer. <!-- NEXT_JS_LLM --> <!-- fleet 0c297c2c-8e55-4012-be8a-752ff8175d1b --> Co-authored-by:vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment