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

Add filestream benchmarks for many files case, fix data race #37345

Merged
merged 2 commits into from
Dec 18, 2023

Conversation

rdner
Copy link
Member

@rdner rdner commented Dec 7, 2023

Before it was only testing for a single file not the tests support many files.

During test runs with the race detector a data race was found and fixed.

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.

How to test this PR locally

This script will generate PDFs with CPU and memory profiles for each test case:

cd ./filebeat/input/filestream

go test -v -run=none -bench='BenchmarkFilestream/single_file/inode_throughput' -benchmem -benchtime=100x -cpuprofile=single-inode-cpu-profile.bin -memprofile=single-inode-mem-profile.bin
go tool pprof -pdf single-inode-cpu-profile.bin > single-inode-cpu-profile.pdf
go tool pprof -pdf single-inode-mem-profile.bin > single-inode-mem-profile.pdf

go test -v -run=none -bench='BenchmarkFilestream/single_file/fingerprint_throughput' -benchmem -benchtime=100x -cpuprofile=single-fp-cpu-profile.bin -memprofile=single-fp-mem-profile.bin
go tool pprof -pdf single-fp-cpu-profile.bin > single-fp-cpu-profile.pdf
go tool pprof -pdf single-fp-mem-profile.bin > single-fp-mem-profile.pdf

go test -v -run=none -bench='BenchmarkFilestream/many_files/inode_throughput' -benchmem -benchtime=10x -cpuprofile=many-inode-cpu-profile.bin -memprofile=many-inode-mem-profile.bin
go tool pprof -pdf many-inode-cpu-profile.bin > many-inode-cpu-profile.pdf
go tool pprof -pdf many-inode-mem-profile.bin > many-inode-mem-profile.pdf

go test -v -run=none -bench='BenchmarkFilestream/many_files/fingerprint_throughput' -benchmem -benchtime=10x -cpuprofile=many-fp-cpu-profile.bin -memprofile=many-fp-mem-profile.bin
go tool pprof -pdf many-fp-cpu-profile.bin > many-fp-cpu-profile.pdf
go tool pprof -pdf many-fp-mem-profile.bin > many-fp-mem-profile.pdf

many-fp-cpu-profile.pdf
many-fp-mem-profile.pdf
many-inode-cpu-profile.pdf
many-inode-mem-profile.pdf
single-fp-cpu-profile.pdf
single-fp-mem-profile.pdf
single-inode-cpu-profile.pdf
single-inode-mem-profile.pdf

Related issues

Before it was only testing for a single file not the tests support
many files.

During test runs with the race detector a data race was found and fixed.
@rdner rdner added enhancement Filebeat Filebeat backport-skip Skip notification from the automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Dec 7, 2023
@rdner rdner self-assigned this Dec 7, 2023
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Dec 7, 2023
@rdner rdner marked this pull request as ready for review December 7, 2023 20:18
@rdner rdner requested a review from a team as a code owner December 7, 2023 20:18
@elasticmachine
Copy link
Collaborator

💚 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: 2023-12-07T18:57:49.268+0000

  • Duration: 133 min 27 sec

Test stats 🧪

Test Results
Failed 0
Passed 8315
Skipped 755
Total 9070

💚 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!)

@rdner rdner enabled auto-merge (squash) December 8, 2023 13:42
@rdner rdner requested a review from belimawr December 8, 2023 15:50
@elasticmachine
Copy link
Collaborator

💚 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

  • Duration: 132 min 8 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 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!)

@rdner rdner merged commit a633696 into elastic:main Dec 18, 2023
29 checks passed
@rdner rdner deleted the filestream-many-files-benchmark branch December 18, 2023 15:24
Scholar-Li pushed a commit to Scholar-Li/beats that referenced this pull request Feb 5, 2024
…#37345)

Before it was only testing for a single file not the tests support
many files.

During test runs with the race detector a data race was found and fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-skip Skip notification from the automated backport with mergify enhancement Filebeat Filebeat 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