feat: print a warning if network requests are slow#10025
Merged
Conversation
add a new setting for fetch tarball speed
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds network performance monitoring to pnpm by implementing warnings for slow network requests, including both metadata fetches and tarball downloads.
Key changes:
- Add configuration options for warning thresholds (
fetchWarnTimeoutMsandfetchMinSpeedKiBps) - Implement timing measurements and speed calculations for network operations
- Display warning messages when requests exceed time thresholds or fall below speed minimums
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
store/store-connection-manager/src/createNewStoreController.ts |
Pass through new fetch warning configuration options |
resolving/npm-resolver/src/index.ts |
Update resolver to use renamed fetch function and pass warning timeout configuration |
resolving/npm-resolver/src/fetch.ts |
Rename function and add timing measurement with warning for slow metadata requests |
pkg-manager/client/src/index.ts |
Add fetchMinSpeedKiBps option to client interface |
fetching/tarball-fetcher/src/remoteTarballFetcher.ts |
Add speed monitoring and warnings for slow tarball downloads |
fetching/tarball-fetcher/src/index.ts |
Wire through speed configuration options |
config/config/src/types.ts |
Define new configuration option types |
config/config/src/index.ts |
Set default values for warning thresholds |
config/config/src/Config.ts |
Add new options to Config interface |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Contributor
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
vaernion
pushed a commit
to Arbeidstilsynet/brevgen2
that referenced
this pull request
Dec 3, 2025
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [pnpm](https://pnpm.io) ([source](https://github.com/pnpm/pnpm/tree/HEAD/pnpm)) | [`10.17.1` -> `10.18.0`](https://renovatebot.com/diffs/npm/pnpm/10.17.1/10.18.0) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pnpm/pnpm (pnpm)</summary> ### [`v10.18.0`](https://github.com/pnpm/pnpm/blob/HEAD/pnpm/CHANGELOG.md#10180) [Compare Source](pnpm/pnpm@v10.17.1...v10.18.0) ##### Minor Changes - Added network performance monitoring to pnpm by implementing warnings for slow network requests, including both metadata fetches and tarball downloads. Added configuration options for warning thresholds: `fetchWarnTimeoutMs` and `fetchMinSpeedKiBps`. Warning messages are displayed when requests exceed time thresholds or fall below speed minimums Related PR: [#​10025](pnpm/pnpm#10025). ##### Patch Changes - Retry filesystem operations on EAGAIN errors [#​9959](pnpm/pnpm#9959). - Outdated command respects `minimumReleaseAge` configuration [#​10030](pnpm/pnpm#10030). - Correctly apply the `cleanupUnusedCatalogs` configuration when removing dependent packages. - Don't fail with a meaningless error when `scriptShell` is set to `false` [#​8748](pnpm/pnpm#8748). - `pnpm dlx` should not fail when `minimumReleaseAge` is set [#​10037](pnpm/pnpm#10037). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or PR is renamed to start with "rebase!". 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Related work items: #30372
jdx
added a commit
to endevco/aube
that referenced
this pull request
Apr 19, 2026
The `fetchMinSpeedKiBps` warning fired on any tarball ≥1 KiB with non-zero elapsed time, so small-but-normal downloads (e.g. a 5 KiB tarball finishing in 150 ms) tripped it constantly — handshake and TTFB dominate the computed average there, not real throughput. Replace the `len >= 1024` gate with `elapsed > 1s`, mirroring pnpm/pnpm#10025. Update unit tests and the settings docs accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
jdx
added a commit
to endevco/aube
that referenced
this pull request
Apr 19, 2026
## Summary - The `fetchMinSpeedKiBps` warning fired on any tarball ≥1 KiB with non-zero elapsed time, so small-but-normal downloads (e.g. a 5 KiB tarball finishing in 150 ms) tripped it constantly — handshake and TTFB dominate the computed "average" there, not real throughput. - Replace the `len >= 1024` gate in `warn_slow_tarball` with `elapsed > 1s`, mirroring pnpm's [`elapsedSec > 1`](pnpm/pnpm#10025) gate in its remote tarball fetcher. - Update the unit tests in `crates/aube-registry/src/client.rs` (new sub-second and 1-second boundary cases; the fast/slow cases now use >1s elapsed so the math actually runs) and regenerate the `fetchMinSpeedKiBps` settings docs. ## Test plan - [x] `cargo test -p aube-registry` (74 passed, including the 5 `slow_tarball_tests` cases) - [x] `cargo clippy -p aube-registry -p aube-settings --all-targets -- -D warnings` - [x] `cargo fmt --check` - [x] `cargo run -p aube-settings --bin generate-settings-docs` (regenerated `docs/settings/*.md`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: changes only the conditions under which an observability `fetchMinSpeedKiBps` warning is emitted, not the actual download behavior or retry logic. > > **Overview** > Reduces noisy `fetchMinSpeedKiBps` warnings by changing `warn_slow_tarball` to skip throughput checks for transfers that complete in **≤ 1s** (and empty bodies), mirroring pnpm’s `elapsedSec > 1` gate. > > Updates the pure-function unit tests to cover sub-second and 1-second boundary cases and adjusts the fast/slow scenarios so the speed calculation runs past the new gate, and regenerates the `fetchMinSpeedKiBps` settings docs to match the simplified behavior description. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 23ace11. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.