Skip to content

Commit

Permalink
Fix duplicate collectors (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost authored Jun 8, 2023
1 parent cd9ea1e commit 7b79f48
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions pkg/bench/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (g *Get) Prepare(ctx context.Context) error {
return (fmt.Errorf("no objects found for bucket %s", g.Bucket))
}
done()
g.Collector = NewCollector()
g.addCollector()
return nil
}

Expand Down Expand Up @@ -141,7 +141,6 @@ func (g *Get) Prepare(ctx context.Context) error {

var wg sync.WaitGroup
wg.Add(g.Concurrency)
g.addCollector()

obj := make(chan struct{}, g.CreateObjects)
for i := 0; i < g.CreateObjects; i++ {
Expand Down
3 changes: 1 addition & 2 deletions pkg/bench/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ import (
// List benchmarks listing speed.
type List struct {
Common
Collector *Collector
objects []generator.Objects
objects []generator.Objects

CreateObjects int
Versions int
Expand Down
3 changes: 1 addition & 2 deletions pkg/bench/mixed.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ import (
// Mixed benchmarks mixed operations all inclusive.
type Mixed struct {
Common
Collector *Collector
Dist *MixedDistribution
Dist *MixedDistribution

GetOpts minio.GetObjectOptions
StatOpts minio.StatObjectOptions
Expand Down
1 change: 0 additions & 1 deletion pkg/bench/select.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
// Select benchmarks download speed.
type Select struct {
Common
Collector *Collector

// Default Select options.
SelectOpts minio.SelectObjectOptions
Expand Down

0 comments on commit 7b79f48

Please sign in to comment.