From 436351a393c0a775d598ffe756c65661a242be70 Mon Sep 17 00:00:00 2001 From: "Lee E. Hinman" Date: Tue, 12 Mar 2024 18:34:59 -0500 Subject: [PATCH] fixes based on review --- libbeat/outputs/discard/discard.go | 3 --- libbeat/outputs/discard/docs/discard.asciidoc | 4 ++-- x-pack/filebeat/docs/inputs/input-benchmark.asciidoc | 8 ++++---- x-pack/filebeat/input/benchmark/input.go | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/libbeat/outputs/discard/discard.go b/libbeat/outputs/discard/discard.go index e348c2eb1b11..a33462f5c2a7 100644 --- a/libbeat/outputs/discard/discard.go +++ b/libbeat/outputs/discard/discard.go @@ -70,9 +70,6 @@ func (out *discardOutput) Publish(_ context.Context, batch publisher.Batch) erro st := out.observer events := batch.Events() st.NewBatch(len(events)) - for range events { - st.WriteError(nil) - } st.Acked(len(events)) return nil } diff --git a/libbeat/outputs/discard/docs/discard.asciidoc b/libbeat/outputs/discard/docs/discard.asciidoc index b17ca18761dd..3e2990cb93ba 100644 --- a/libbeat/outputs/discard/docs/discard.asciidoc +++ b/libbeat/outputs/discard/docs/discard.asciidoc @@ -8,10 +8,10 @@ The Discard output throws away data. WARNING: The Discard output should be used only for development or -debugging issues. Data is lost. +debugging issues. Data is lost. This can be useful if you want to work on your input configuration -without needing to configure an output. It can also be useful to test +without needing to configure an output. It can also be useful to test how changes in input and processor configuration affect performance. Example configuration: diff --git a/x-pack/filebeat/docs/inputs/input-benchmark.asciidoc b/x-pack/filebeat/docs/inputs/input-benchmark.asciidoc index aeab32e6f4a7..db8036973357 100644 --- a/x-pack/filebeat/docs/inputs/input-benchmark.asciidoc +++ b/x-pack/filebeat/docs/inputs/input-benchmark.asciidoc @@ -11,7 +11,7 @@ beta[] -The Benchmark input generates generic events and sends them to the output. This can be useful when you want to benchmark the difference between outputs or output settings. +The Benchmark input generates generic events and sends them to the output. This can be useful when you want to benchmark the difference between outputs or output settings. Example configurations: @@ -60,17 +60,17 @@ This is the value that will be in the `message` field of the json document. [float] ==== `threads` -This is the number of go routines that will be started generating messages. Normally 1 thread can saturate an output but if necessary this can be increased. +This is the number of goroutines that will be started generating messages. Normally 1 thread can saturate an output but if necessary this can be increased. [float] ==== `count` -This is the number of messages to send. 0 represents sending infinite messages. This is mutually exclusive with the `eps` option. +This is the number of messages to send. 0 represents sending infinite messages. This is mutually exclusive with the `eps` option. [float] ==== `eps` -This is the number of events per second to send. 0 represents sending as quickly as possible. This is mutually exclusive with the `count` option. +This is the number of events per second to send. 0 represents sending as quickly as possible. This is mutually exclusive with the `count` option. [float] diff --git a/x-pack/filebeat/input/benchmark/input.go b/x-pack/filebeat/input/benchmark/input.go index 832fb4d87087..dd6d198cc409 100644 --- a/x-pack/filebeat/input/benchmark/input.go +++ b/x-pack/filebeat/input/benchmark/input.go @@ -89,7 +89,7 @@ func runThread(ctx v2.Context, publisher stateless.Publisher, thread uint8, cfg default: publishEvt(publisher, cfg.Message, line, name, thread, metrics) line++ - if (line % cfg.Count) == 0 { + if line == cfg.Count { return } }