speedtest-go icon indicating copy to clipboard operation
speedtest-go copied to clipboard

(API) Allow for caller to specify the size of upload/download tests

Open cirne opened this issue 1 year ago • 1 comments

https://github.com/showwin/speedtest-go/blob/856e6e6726b7fc8e8552075805ef1a92d0c26b81/speedtest/request.go#L96

It appears that server.DownloadTest and server.UploadTest use a hard coded image size (which essentially drives the bandwidth impact of these tests) to dlSizes[3] and ulSizes[3].

https://github.com/showwin/speedtest-go/blob/856e6e6726b7fc8e8552075805ef1a92d0c26b81/speedtest/request.go#L20-L23

I am using the GO API to write a simple program that periodically runs speedtest on a regular basis. I'd like to reduce the size of each download/upload test to reduce overall bandwidth consumption since it will be run on an ongoing basis. Recognizing the is likely a tradeoff between test size/bandwith impact and accuracy, but it would be great if the developer could evaluate that tradeoff rather than rely on the hardcoded values currently provided.

cirne avatar Mar 27 '23 17:03 cirne

Hi, @cirne. I think reduce the size of each download/upload request will not reduce overall bandwidth consumption. Because reducing the size will send more download/upload requests. The overall result will not be much different.

r3inbowari avatar Mar 29 '23 08:03 r3inbowari