Skip to content

Commit

Permalink
Merge pull request #33 from showwin/bugfix/upload_weight
Browse files Browse the repository at this point in the history
Using dynamic weight when uploading test
  • Loading branch information
showwin authored Mar 30, 2021
2 parents 7d79129 + 68e0fbb commit c27c2c9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions speedtest/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (s *Server) UploadTest(savingMode bool) error {
sTime = time.Now()
for i := 0; i < workload; i++ {
eg.Go(func() error {
return uploadRequest(s.URL)
return uploadRequest(s.URL, weight)
})
}
if err := eg.Wait(); err != nil {
Expand Down Expand Up @@ -179,8 +179,8 @@ func downloadRequest(dlURL string, w int) error {
return nil
}

func uploadRequest(ulURL string) error {
size := ulSizes[9]
func uploadRequest(ulURL string, w int) error {
size := ulSizes[w]
v := url.Values{}
v.Add("content", strings.Repeat("0123456789", size*100-51))

Expand Down

0 comments on commit c27c2c9

Please sign in to comment.