Skip to content

Commit

Permalink
Improve design of internal/stanza log converter (#3125)
Browse files Browse the repository at this point in the history
* Improve design of internal/stanza log converter

* internal/stanza/converter: Fix default number of workers

* Rebase on top of main

* Use 1 log conversion worker to have reliable results in tests
  • Loading branch information
pmalek authored May 12, 2021
1 parent 6b9e20e commit 8a42832
Show file tree
Hide file tree
Showing 8 changed files with 428 additions and 182 deletions.
4 changes: 4 additions & 0 deletions internal/stanza/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ type ConverterConfig struct {
// FlushInterval defines how often to flush the converted and accumulated
// log entries.
FlushInterval time.Duration `mapstructure:"flush_interval"`
// WorkerCount defines how many worker goroutines used for entry.Entry to
// log records translation should be spawned.
// By default: math.Max(1, runtime.NumCPU()/4) workers are spawned.
WorkerCount int `mapstructure:"worker_count"`
}

// InputConfig is an alias that allows unmarshaling outside of mapstructure
Expand Down
Loading

0 comments on commit 8a42832

Please sign in to comment.