Skip to content

Commit

Permalink
[chore] filelogreceiver remove dead code related to maxworkers (#37709)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Feb 5, 2025
1 parent 5bc5a09 commit 54cdd33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
17 changes: 5 additions & 12 deletions pkg/stanza/adapter/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ func TestEndToEnd(t *testing.T) {
}

type benchCase struct {
workerCount int
maxBatchSize uint
flushInterval time.Duration
}
Expand All @@ -55,7 +54,6 @@ func (bc benchCase) run(b *testing.B) {
for i := 0; i < b.N; i++ {
f := NewFactory(BenchReceiverType{}, component.StabilityLevelUndefined)
cfg := f.CreateDefaultConfig().(*BenchConfig)
cfg.BaseConfig.numWorkers = bc.workerCount
cfg.BaseConfig.maxBatchSize = bc.maxBatchSize
cfg.BaseConfig.flushInterval = bc.flushInterval
cfg.BenchOpConfig.NumEntries = numEntries
Expand Down Expand Up @@ -89,21 +87,16 @@ func BenchmarkEndToEnd(b *testing.B) {
// These values may have meaningful performance implications, so benchmarks
// should cover a variety of values in order to highlight impacts.
var (
// converter
workerCounts = []int{1, 2, 4, 8, 16}

// emitter
maxBatchSizes = []uint{1, 10, 100, 1000, 10_000}
flushIntervals = []time.Duration{10 * time.Millisecond, 100 * time.Millisecond}
)

for _, wc := range workerCounts {
for _, bs := range maxBatchSizes {
for _, fi := range flushIntervals {
name := fmt.Sprintf("workerCount=%d,maxBatchSize=%d,flushInterval=%s", wc, bs, fi)
bc := benchCase{workerCount: wc, maxBatchSize: bs, flushInterval: fi}
b.Run(name, bc.run)
}
for _, bs := range maxBatchSizes {
for _, fi := range flushIntervals {
name := fmt.Sprintf("maxBatchSize=%d,flushInterval=%s", bs, fi)
bc := benchCase{maxBatchSize: bs, flushInterval: fi}
b.Run(name, bc.run)
}
}
}
Expand Down
1 change: 0 additions & 1 deletion pkg/stanza/adapter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ type BaseConfig struct {
RetryOnFailure consumerretry.Config `mapstructure:"retry_on_failure"`

// currently not configurable by users, but available for benchmarking
numWorkers int
maxBatchSize uint
flushInterval time.Duration
}

0 comments on commit 54cdd33

Please sign in to comment.