showwin/speedtest-go

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

cirne opened this issue · 1 comments

cirne commented

_ = downloadRequest(_context, s, 3)

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].

var (
dlSizes = [...]int{350, 500, 750, 1000, 1500, 2000, 2500, 3000, 3500, 4000}
ulSizes = [...]int{100, 300, 500, 800, 1000, 1500, 2500, 3000, 3500, 4000} // kB
)

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.

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.