feat: add a mach saturate command to saturate a network and determine its capacity
#33
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.
This PR adds a new command
mach saturate <direction>which saturates the network in the given direction.When
bothis requested, the download and upload directions of the network are tested simultaneously.The output is a simple JSON which describes the capacity of the network:
Implementation
The implementation is actually a small modification to the responsiveness (RPM) test. We simply add a flag to the RPM test which disables sending of the first probe. The RPM test will find the network capacity and break after the maximum duration has been reached.
Also, we add support for plaintext HTTP/1.1 connections to the given origin. This should remove any overhead from TLS and means the calculated goodput should be closer to the true bandwidth.
Finally, we modernize the repo a bit and fix a bug around upload body counting.