Merge pull request #7 from markhpc/wip-read-bodyclose
hsbench: Close the resp body instead of copying to ioutil.Discardmaster
commit
6176271af8
|
@ -20,8 +20,6 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
"github.com/aws/aws-sdk-go/service/s3"
|
"github.com/aws/aws-sdk-go/service/s3"
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
@ -548,13 +546,10 @@ func runDownload(thread_num int, fendtime time.Time, stats *Stats) {
|
||||||
stats.addSlowDown(thread_num)
|
stats.addSlowDown(thread_num)
|
||||||
log.Printf("download err", err)
|
log.Printf("download err", err)
|
||||||
} else {
|
} else {
|
||||||
|
resp.Body.Close()
|
||||||
// Update the stats
|
// Update the stats
|
||||||
stats.addOp(thread_num, object_size, end-start)
|
stats.addOp(thread_num, object_size, end-start)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err == nil {
|
|
||||||
_, err = io.Copy(ioutil.Discard, resp.Body)
|
|
||||||
}
|
|
||||||
if errcnt > 2 {
|
if errcnt > 2 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue