parent
bdf41e7a30
commit
14e1dec818
36
hsbench.go
36
hsbench.go
|
@ -632,9 +632,9 @@ func runBucketDelete(thread_num int, stats *Stats) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func runBucketList(thread_num int, stats *Stats) {
|
func runBucketList(thread_num int, stats *Stats) {
|
||||||
svc := s3.New(session.New(), cfg)
|
svc := s3.New(session.New(), cfg)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
bucket_num := atomic.AddInt64(&op_counter, 1)
|
bucket_num := atomic.AddInt64(&op_counter, 1)
|
||||||
if bucket_num >= bucket_count {
|
if bucket_num >= bucket_count {
|
||||||
atomic.AddInt64(&op_counter, -1)
|
atomic.AddInt64(&op_counter, -1)
|
||||||
|
@ -644,23 +644,23 @@ func runBucketList(thread_num int, stats *Stats) {
|
||||||
start := time.Now().UnixNano()
|
start := time.Now().UnixNano()
|
||||||
err := svc.ListObjectsPages(
|
err := svc.ListObjectsPages(
|
||||||
&s3.ListObjectsInput{
|
&s3.ListObjectsInput{
|
||||||
Bucket: &buckets[bucket_num],
|
Bucket: &buckets[bucket_num],
|
||||||
MaxKeys: &max_keys,
|
MaxKeys: &max_keys,
|
||||||
},
|
},
|
||||||
func (p *s3.ListObjectsOutput, last bool) bool {
|
func(p *s3.ListObjectsOutput, last bool) bool {
|
||||||
end := time.Now().UnixNano()
|
end := time.Now().UnixNano()
|
||||||
stats.updateIntervals(thread_num)
|
stats.updateIntervals(thread_num)
|
||||||
stats.addOp(thread_num, 0, end-start)
|
stats.addOp(thread_num, 0, end-start)
|
||||||
start = time.Now().UnixNano()
|
start = time.Now().UnixNano()
|
||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stats.finish(thread_num)
|
stats.finish(thread_num)
|
||||||
atomic.AddInt64(&running_threads, -1)
|
atomic.AddInt64(&running_threads, -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
var cfg *aws.Config
|
var cfg *aws.Config
|
||||||
|
@ -770,10 +770,10 @@ func runWrapper(loop int, r rune) []OutputStats {
|
||||||
}
|
}
|
||||||
case 'l':
|
case 'l':
|
||||||
log.Printf("Running Loop %d BUCKET LIST TEST", loop)
|
log.Printf("Running Loop %d BUCKET LIST TEST", loop)
|
||||||
stats = makeStats(loop, "LIST", threads, intervalNano)
|
stats = makeStats(loop, "LIST", threads, intervalNano)
|
||||||
for n := 0; n < threads; n++ {
|
for n := 0; n < threads; n++ {
|
||||||
go runBucketList(n, &stats)
|
go runBucketList(n, &stats)
|
||||||
}
|
}
|
||||||
case 'g':
|
case 'g':
|
||||||
log.Printf("Running Loop %d OBJECT GET TEST", loop)
|
log.Printf("Running Loop %d OBJECT GET TEST", loop)
|
||||||
stats = makeStats(loop, "GET", threads, intervalNano)
|
stats = makeStats(loop, "GET", threads, intervalNano)
|
||||||
|
@ -828,7 +828,7 @@ func init() {
|
||||||
myflag.StringVar(&modes, "m", "cxiplgdcx", "Run modes in order. See NOTES for more info")
|
myflag.StringVar(&modes, "m", "cxiplgdcx", "Run modes in order. See NOTES for more info")
|
||||||
myflag.StringVar(&output, "o", "", "Write CSV output to this file")
|
myflag.StringVar(&output, "o", "", "Write CSV output to this file")
|
||||||
myflag.StringVar(&json_output, "j", "", "Write JSON output to this file")
|
myflag.StringVar(&json_output, "j", "", "Write JSON output to this file")
|
||||||
myflag.Int64Var(&max_keys, "mk", 1000, "Maximum number of keys to retreive at once for bucket listings")
|
myflag.Int64Var(&max_keys, "mk", 1000, "Maximum number of keys to retreive at once for bucket listings")
|
||||||
myflag.Int64Var(&object_count, "n", -1, "Maximum number of objects <-1 for unlimited>")
|
myflag.Int64Var(&object_count, "n", -1, "Maximum number of objects <-1 for unlimited>")
|
||||||
myflag.Int64Var(&bucket_count, "b", 1, "Number of buckets to distribute IOs across")
|
myflag.Int64Var(&bucket_count, "b", 1, "Number of buckets to distribute IOs across")
|
||||||
myflag.IntVar(&duration_secs, "d", 60, "Maximum test duration in seconds <-1 for unlimited>")
|
myflag.IntVar(&duration_secs, "d", 60, "Maximum test duration in seconds <-1 for unlimited>")
|
||||||
|
|
Loading…
Reference in New Issue