Skip to content

feat: add parallel bandwidth measurements - #154

Draft
andre-j3sus wants to merge 1 commit into
mainfrom
ajesus/add-parallel-bandwidth-hosts
Draft

feat: add parallel bandwidth measurements#154
andre-j3sus wants to merge 1 commit into
mainfrom
ajesus/add-parallel-bandwidth-hosts

Conversation

@andre-j3sus

@andre-j3sus andre-j3sus commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Adds configurable bandwidth origins and numeric parallelism at both the test and individual-step levels. Bandwidth requests run in bounded batches, with aggregate bytes and throughput calculated across each overlapping transfer window and reported through the existing results payload.

Sequential execution remains the default, while physical-request logging stays per request and final session metadata records the expected maximum parallelism.

new SpeedTest({
  bandwidthOrigins: [
    "https://speed-0.example.com",
    "https://speed-1.example.com",
    "https://speed-2.example.com",
    "https://speed-3.example.com"
  ],
  parallelism: 4,
  measurements: [
    { type: "download", bytes: 1e7, count: 8 },
    { type: "upload", bytes: 1e7, count: 8 },
    { type: "download", bytes: 2.5e7, count: 2, parallelism: 1 }
  ]
});

@andre-j3sus andre-j3sus self-assigned this Aug 28, 2026
@ask-bonk

ask-bonk Bot commented Aug 28, 2026

Copy link
Copy Markdown

LGTM!

github run

Comment thread README.md
| **autoStart**: *boolean* | Whether to automatically start the measurements on instantiation. | `true` |
| **downloadApiUrl**: *string* | The URL of the API for performing download GET requests. | `https://speed.cloudflare.com/__down` |
| **uploadApiUrl**: *string* | The URL of the API for performing upload POST requests. | `https://speed.cloudflare.com/__up` |
| **bandwidthOrigins**: *string[]* | Origins used for bandwidth requests. The engine appends `/__down` or `/__up` and distributes parallel requests across the origins. When omitted, `downloadApiUrl` and `uploadApiUrl` are used. | `[]` |

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

API design question: The current API uses complete endpoint URLs:

downloadApiUrl: "https://speed.cloudflare.com/__down"
uploadApiUrl: "https://speed.cloudflare.com/__up"

This proposal adds bandwidthOrigins and derives /__down and /__up automatically:

bandwidthOrigins: ["https://speed-0.example.com"]

To remain consistent with the existing full-URL approach, alternatives would be paired endpoints:

bandwidthEndpoints: [{ download: ".../__down", upload: ".../__up" }]

or separate downloadApiUrls and uploadApiUrls arrays. Reviewers, which contract do you prefer?

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.

1 participant