Skip to content

Commit

Permalink
Merge pull request danielqsj#291 from echernous/fix/topic-metadata-wo…
Browse files Browse the repository at this point in the history
…rkers

Fix number of workers
  • Loading branch information
danielqsj authored Jan 18, 2022
2 parents 15e4ad6 + b373e46 commit 6e14e80
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kafka_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,11 @@ func (e *Exporter) collect(ch chan<- prometheus.Metric) {
}
}

N := minx(len(topics)/2, e.topicWorkers)
N := len(topics)
if N > 1 {
N = minx(N/2, e.topicWorkers)
}

for w := 1; w <= N; w++ {
go loopTopics(w)
}
Expand Down

0 comments on commit 6e14e80

Please sign in to comment.