diff --git a/cmd/objbench.go b/cmd/objbench.go index 48e2da9e6990..9b12925561f6 100644 --- a/cmd/objbench.go +++ b/cmd/objbench.go @@ -253,11 +253,6 @@ func objbench(ctx *cli.Context) error { count: bCount, title: "download objects", startKey: sCount, - after: func(blob object.ObjectStorage) { - for i := sCount; i < sCount+bCount; i++ { - _ = blob.Delete(strconv.Itoa(i)) - } - }, getResult: func(cost float64) []string { line := []string{"", nspt, nspt} if cost > 0 { @@ -274,7 +269,7 @@ func objbench(ctx *cli.Context) error { getResult: func(cost float64) []string { line := []string{"", nspt, nspt} if cost > 0 { - line[1], line[2] = colorize("list", float64(sCount)*100/cost, float64(threads)*cost*10, 2, colorful) + line[1], line[2] = colorize("list", float64(sCount+bCount)*100/cost, float64(threads)*cost*10, 2, colorful) line[1] += " objects/s" line[2] += " ms/op" } @@ -334,12 +329,12 @@ func objbench(ctx *cli.Context) error { }, }, { name: "delete", - count: sCount, + count: sCount + bCount, title: "delete objects", getResult: func(cost float64) []string { line := []string{"", nspt, nspt} if cost > 0 { - line[1], line[2] = colorize("delete", float64(sCount)/cost, float64(threads)*cost*1000/float64(sCount), 1, colorful) + line[1], line[2] = colorize("delete", float64(sCount+bCount)/cost, float64(threads)*cost*1000/float64(sCount), 1, colorful) line[1] += " objects/s" line[2] += " ms/object" } @@ -435,7 +430,6 @@ type apiInfo struct { count int startKey int getResult func(cost float64) []string - after func(blob object.ObjectStorage) } type benchMarkObj struct { @@ -485,9 +479,6 @@ func (bm *benchMarkObj) run(api apiInfo) []string { var wg sync.WaitGroup pool := make(chan struct{}, bm.threads) count := api.count - if api.count != 0 { - count = api.count - } bar := bm.progressBar.AddCountBar(api.title, int64(count)) var err error start := time.Now() @@ -508,9 +499,6 @@ func (bm *benchMarkObj) run(api apiInfo) []string { wg.Wait() bar.Done() line := api.getResult(time.Since(start).Seconds()) - if api.after != nil { - api.after(bm.blob) - } if err != nil { logger.Errorf("%s test failed: %s", api.name, err) return []string{api.title, failed, failed}