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 benchmark for processors that create event backups #36960

Merged
merged 1 commit into from
Oct 26, 2023

Conversation

rdner
Copy link
Member

@rdner rdner commented Oct 25, 2023

This will come handy once we have another PR with optimizations.

Also, extended a test case in the append processor due to the lack of coverage.

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

cd ./libbeat/processors
go test -run=none -bench=".*EventBackups.*" -benchmem -benchtime=10x -memprofile mem-before.bin

On my machine I get:

goos: darwin
goarch: arm64
pkg: github.com/elastic/beats/v7/libbeat/processors
BenchmarkEventBackups/run_processors_that_use_backups-10                      10         336269333 ns/op        251485534 B/op    435076 allocs/op
PASS
ok      github.com/elastic/beats/v7/libbeat/processors  4.265s

336269333 ns/op 251485534 B/op 435076 allocs/op

mem-before-editor

As you can see, the current issue is that we clone the event every time and allocate a lot for this. This issue should be addressed by #36958

Related issues

@rdner rdner added enhancement libbeat backport-skip Skip notification from the automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Oct 25, 2023
@rdner rdner self-assigned this Oct 25, 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 Oct 25, 2023
This will come handy once we have another PR with optimizations.

Also, extended a test case in the append processor due to the lack of coverage.
@rdner rdner force-pushed the processors-backup-benchmark branch from 8e12d9a to b08e95f Compare October 25, 2023 14:42
@elasticmachine
Copy link
Collaborator

elasticmachine commented Oct 25, 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

  • Duration: 72 min 9 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 marked this pull request as ready for review October 25, 2023 15:58
@rdner rdner requested a review from a team as a code owner October 25, 2023 15:58
@rdner rdner requested review from ycombinator and belimawr October 25, 2023 15:58
@rdner rdner merged commit 8982110 into elastic:main Oct 26, 2023
5 of 7 checks passed
@rdner rdner deleted the processors-backup-benchmark branch October 26, 2023 10:45
Scholar-Li pushed a commit to Scholar-Li/beats that referenced this pull request Feb 5, 2024
This will come handy once we have another PR with optimizations.

Also, extended a test case in the append processor due to the lack of coverage.
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 libbeat 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