fix(outputs.influxdb_v2): Correct calculation of amount of batches for concurrent writes#18014
Conversation
67e750f to
1f81ae2
Compare
srebhan
left a comment
There was a problem hiding this comment.
Thanks for catching this @AndrewChubatiuk! Only one request to move your testing into an own test-function to not distort the benchmarks!
1f81ae2 to
31eea20
Compare
srebhan
left a comment
There was a problem hiding this comment.
Thanks a lot @AndrewChubatiuk!
skartikey
left a comment
There was a problem hiding this comment.
@AndrewChubatiuk Thanks! A couple of minor comments.
31eea20 to
a912da5
Compare
|
@skartikey thanks for review |
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
skartikey
left a comment
There was a problem hiding this comment.
@AndrewChubatiuk Thanks for the contribution!
Summary
in influxdb_v2 output with
concurrent_writes> 1 part of data may be droppedhere algorithm calculates a size of buffer dividing amount of metrics by workers count and increments by one if remainder is > 0, but this is not taken into account during calculation of batches count inside
createBatches.In current implementation with metrics slice of size
100kand concurrent_writes set to13telegraf drops7684items(100000 // ⌈100000/13⌉) * ⌈100000/13⌉= (100000//7693) * 7693 = 12 * 7693 = 92316Checklist