Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filebeat benchmark input and discard output #37437

Merged
merged 6 commits into from
Apr 12, 2024

Conversation

leehinman
Copy link
Contributor

@leehinman leehinman commented Dec 13, 2023

Proposed commit message

filebeat benchmark input and discard output

benchmark is simple input that generates synthetic events, useful for benchmarking outputs or for providing load on outputs.

The message of each event is set in the config file. Event duplication is avoided with the thread, line and filename fields. Each go routine that generates an event sets a unique thread field. Within each each thread, every event that is generated increments the line field. The line field is a uint64, if the max is reached then the filename field is incremented and line is reset to 0.

The default behavior is to generate events as quickly as possible until filebeat is stopped. Optionally you can set the count option, which will generate that number of events and then stop. Or you can use the eps option which allows you to set an events generated per second.

discard is a simple output that throws the data away, but records in the metrics that an event was successfully sent.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • [ ]

How to test this PR locally

In filebeat.yml add:

filebeat.inputs:
- type: benchmark
  message: "uninspired test message"

output.discard:

This should result in events with the message field set to "uninspried test message", generated as quickly as possible until filebeat is stopped.

Related issues

Use cases

  • tracking down performance issues
  • generating a consistent load for outputs
  • performance testing inputs and processors

Screenshots

Logs

{
  "@timestamp": "2023-12-05T19:09:49.504Z",
  "@metadata": {
    "beat": "filebeat",
    "type": "_doc",
    "version": "8.12.0"
  },
  "ecs": {
    "version": "8.0.0"
  },
  "host": {
    "name": "elastic2"
  },
  "agent": {
    "id": "796fb7fc-e337-4ee0-b1f2-88f133a5e801",
    "name": "elastic2",
    "type": "filebeat",
    "version": "8.12.0",
    "ephemeral_id": "d3318883-aac0-4903-a1fc-1692aade498f"
  },
  "message": "generic message",
  "line": 21049584,
  "filename": 0,
  "thread": 0,
  "input": {
    "type": "benchmark"
  }
}

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 13, 2023
Copy link
Contributor

mergify bot commented Dec 13, 2023

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @leehinman? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@leehinman leehinman added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Dec 13, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 13, 2023
@leehinman leehinman added enhancement needs_team Indicates that the issue/PR needs a Team:* label labels Dec 13, 2023
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 13, 2023
@elasticmachine
Copy link
Collaborator

❕ Build Aborted

Either there was a build timeout or someone aborted the build.

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Duration: 7 min 50 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

❕ Build Aborted

Either there was a build timeout or someone aborted the build.

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Duration: 31 min 21 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Collaborator

elasticmachine commented Dec 13, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2024-04-11T19:56:25.539+0000

  • Duration: 150 min 3 sec

Test stats 🧪

Test Results
Failed 0
Passed 29452
Skipped 2061
Total 31513

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

mergify bot commented Jan 14, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b spacetime_bench_input upstream/spacetime_bench_input
git merge upstream/main
git push upstream spacetime_bench_input

1 similar comment
Copy link
Contributor

mergify bot commented Feb 5, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b spacetime_bench_input upstream/spacetime_bench_input
git merge upstream/main
git push upstream spacetime_bench_input

Copy link
Contributor

mergify bot commented Feb 5, 2024

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @leehinman? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v8./d.0 is the label to automatically backport to the 8./d branch. /d is the digit

@leehinman leehinman force-pushed the spacetime_bench_input branch 2 times, most recently from c93621f to b63732a Compare March 8, 2024 00:27
@leehinman leehinman changed the title filebeat benchmark input filebeat benchmark input and discard output Mar 8, 2024
@leehinman leehinman marked this pull request as ready for review March 8, 2024 16:18
@leehinman leehinman requested a review from a team as a code owner March 8, 2024 16:18
@leehinman leehinman requested review from belimawr and rdner March 8, 2024 16:18
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

libbeat/outputs/discard/discard.go Outdated Show resolved Hide resolved
libbeat/outputs/discard/docs/discard.asciidoc Outdated Show resolved Hide resolved
libbeat/outputs/discard/docs/discard.asciidoc Outdated Show resolved Hide resolved
x-pack/filebeat/docs/inputs/input-benchmark.asciidoc Outdated Show resolved Hide resolved
x-pack/filebeat/docs/inputs/input-benchmark.asciidoc Outdated Show resolved Hide resolved
x-pack/filebeat/input/benchmark/config.go Show resolved Hide resolved
x-pack/filebeat/input/benchmark/input.go Outdated Show resolved Hide resolved
x-pack/filebeat/input/benchmark/input.go Show resolved Hide resolved
x-pack/filebeat/input/benchmark/input.go Show resolved Hide resolved
@leehinman leehinman force-pushed the spacetime_bench_input branch from b63732a to 454f115 Compare March 12, 2024 23:35
@leehinman leehinman force-pushed the spacetime_bench_input branch 2 times, most recently from e8f8b7b to 436351a Compare March 22, 2024 01:05
@rdner rdner removed their request for review March 22, 2024 13:02
Copy link
Contributor

mergify bot commented Mar 22, 2024

This pull request is now in conflicts. Could you fix it? 🙏
To fixup this pull request, you can check out it locally. See documentation: https://help.github.com/articles/checking-out-pull-requests-locally/

git fetch upstream
git checkout -b spacetime_bench_input upstream/spacetime_bench_input
git merge upstream/main
git push upstream spacetime_bench_input

@leehinman leehinman force-pushed the spacetime_bench_input branch from 436351a to 629c19e Compare March 22, 2024 13:55
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @leehinman

@leehinman leehinman force-pushed the spacetime_bench_input branch 3 times, most recently from f68f628 to 6026da3 Compare March 26, 2024 21:12
@leehinman leehinman force-pushed the spacetime_bench_input branch from 6026da3 to 3c80f56 Compare April 10, 2024 19:51
@leehinman leehinman force-pushed the spacetime_bench_input branch from f8ae3fd to 497c8c6 Compare April 11, 2024 19:56
@leehinman leehinman merged commit e5e85ad into elastic:main Apr 12, 2024
202 of 206 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants