Surface network activity across profiler-cli#6175
Open
canova wants to merge 7 commits into
Open
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6175 +/- ##
==========================================
+ Coverage 83.49% 83.62% +0.13%
==========================================
Files 344 345 +1
Lines 36868 37057 +189
Branches 10343 10370 +27
==========================================
+ Hits 30782 30989 +207
+ Misses 5659 5640 -19
- Partials 427 428 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Introduce src/profile-query/network-summary.ts with the small, UI-independent building blocks used by every network consumer: interval union (wall-clock in-flight time), peak concurrency, the long-lived (long duration, tiny transfer) heuristic, and cache classification. These are pure functions with no profile dependencies; the callers land in the following commits.
The summary now leads with the interval-union in-flight wall-clock time and peak concurrency, computed over all requests intersecting the range. The phase totals are relabeled "summed across concurrent requests" so they no longer read as wall-clock time (they previously showed e.g. "Download: 24m3s" for a 2m28s profile).
Requests still in flight when the recording stopped are now included in
the request list and counted separately ("N request(s) did not complete
during the recording"). Their duration is measured until the end of the
recording, and durations are clamped to the current range so a request
that started before the range does not report more time than the profile
covers.
Requests are now sorted by in-range duration descending by default, with --sort start to get chronological order back. A limited window (the default 20 rows) previously showed the first 20 requests chronologically; agents need the slowest ones. The order is reflected in the header and exposed as an explicit `sort` field in JSON.
Requests with a long duration (> 30s) and a small or absent transfer are flagged with a "(long-lived, low transfer)" suffix. The annotation is informational only and never filters requests out.
Add a network-activity summary to the two entry-point commands so wall-clock waiting is as visible as CPU usage. The headline metric is the interval-union time in flight, plus peak concurrency, in-flight-at- end counts, and the slowest requests carrying marker handles for drill-down. Profile-wide numbers are deduped across processes since the parent process copies every request. The section renders after CPU activity in both commands. Extends network-summary.ts with the per-thread and profile-wide computation on top of the shared helpers, and updates the guide, JSON schemas, and README so the agent-facing prompt teaches the new signals (CPU-bound vs wait-bound, the in-flight metric, marker handles, the long-lived streaming/long-poll annotation, and the --sort flag).
…summaries Route `collectThreadNetwork` through the `gatherNetworkRecords` / `clampInterval` / `clampedDurationMs` helpers that `profile info` and `thread info` already use, and export them from network-summary.ts. This drops the command's own inline copy of the gather / clamp / count / cache logic, so there is a single source of truth for "what are this thread's network requests."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main | Deploy preview
Fixes #6108.
Note that this depends on #6172, so please review that one first. The first commit is that PR, so please ignore it when reviewing this PR as well. I'll rebase this PR once that lands.
This PR adds network information to
pq profile infoandpq thread info. This also fixes a bunch of things things in thepq thread network, but they are all dependent on each other so it's very difficult to split.Example profile https://share.firefox.dev/4aGPacn
Profile info and thread info looks like this: