From c15f3f23ba0b64e65f7f935156dae3902b4a2d80 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 18 Apr 2019 15:16:25 -0700 Subject: [PATCH] runDownload: make objnum a function of upload_count The actual number of uploaded objects corresponds to upload_count, and therefore objnum should be a function of upload_count (download_count typically exceeds upload_count and it does not make any sense to attempt to download objects there were never uploaded). --- s3-benchmark.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s3-benchmark.go b/s3-benchmark.go index d6f7f7a..6161cd1 100644 --- a/s3-benchmark.go +++ b/s3-benchmark.go @@ -238,7 +238,7 @@ func runUpload(thread_num int) { func runDownload(thread_num int) { for time.Now().Before(endtime) { atomic.AddInt32(&download_count, 1) - objnum := rand.Int31n(download_count) + 1 + objnum := rand.Int31n(upload_count) + 1 prefix := fmt.Sprintf("%s/%s/Object-%d", url_host, bucket, objnum) req, _ := http.NewRequest("GET", prefix, nil) setSignature(req)