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

[8.17](backport #6180) Add config generation benchmark #6246

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Dec 9, 2024

What does this PR do?

Add a benchmark for config generation in the coordinator. We specifically profile having a lot of Pods from the Kubernetes provider, which is something that has recently become a problem, and which the configuration generation pipeline doesn't deal with very well. I used test data from a real environment where the problems outlined in #5991 and #5835 could be reproduced.

From profiling the live agent experiencing these issues, this benchmark covers the most expensive parts, so it should be representative.

Current results on main:

goos: linux
goarch: amd64
pkg: github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator
cpu: 13th Gen Intel(R) Core(TM) i7-13700H
BenchmarkCoordinator_generateComponentModel-20    	      30	  36693604 ns/op	35875285 B/op	  810689 allocs/op
BenchmarkCoordinator_generateComponentModel-20    	      28	  37448198 ns/op	35886685 B/op	  810670 allocs/op
BenchmarkCoordinator_generateComponentModel-20    	      27	  37193185 ns/op	35867024 B/op	  810650 allocs/op
BenchmarkCoordinator_generateComponentModel-20    	      22	  47190285 ns/op	35865402 B/op	  810526 allocs/op
BenchmarkCoordinator_generateComponentModel-20    	      31	  59598417 ns/op	35889725 B/op	  810712 allocs/op
BenchmarkCoordinator_generateComponentModel-20    	      31	  38748898 ns/op	35890251 B/op	  810715 allocs/op
BenchmarkCoordinator_generateComponentModel-20    	      28	  38338585 ns/op	35878466 B/op	  810667 allocs/op
BenchmarkCoordinator_generateComponentModel-20    	      27	  38126388 ns/op	35889337 B/op	  810647 allocs/op
BenchmarkCoordinator_generateComponentModel-20    	      31	  37849710 ns/op	35884377 B/op	  810712 allocs/op
BenchmarkCoordinator_generateComponentModel-20    	      27	  37850712 ns/op	35882968 B/op	  810648 allocs/op
PASS
ok  	github.com/elastic/elastic-agent/internal/pkg/agent/application/coordinator	24.152s

Why is it important?

I'd like to make some improvements to the configuration generation in the coordinator, and want a straightforward way of demonstrating their impact.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas

Related issues


This is an automatic backport of pull request #6180 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner December 9, 2024 16:01
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Dec 9, 2024
@mergify mergify bot requested review from michel-laterman and swiatekm and removed request for a team December 9, 2024 16:01
Copy link
Contributor Author

mergify bot commented Dec 9, 2024

Cherry-pick of b3bb590 has failed:

On branch mergify/bp/8.17/pr-6180
Your branch is up to date with 'origin/8.17'.

You are currently cherry-picking commit b3bb590324.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   internal/pkg/agent/application/coordinator/testdata/config.yaml
	new file:   internal/pkg/agent/application/coordinator/testdata/variables.yaml

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/pkg/agent/application/coordinator/coordinator_test.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@swiatekm swiatekm force-pushed the mergify/bp/8.17/pr-6180 branch from 0011acb to a7895cf Compare December 9, 2024 16:15
@swiatekm swiatekm enabled auto-merge (squash) December 9, 2024 16:15
(cherry picked from commit b3bb590)

# Conflicts:
#	internal/pkg/agent/application/coordinator/coordinator_test.go
@swiatekm swiatekm force-pushed the mergify/bp/8.17/pr-6180 branch from a7895cf to b2debf8 Compare December 13, 2024 14:23
Copy link

@swiatekm swiatekm merged commit 084e098 into 8.17 Dec 13, 2024
14 checks passed
@swiatekm swiatekm deleted the mergify/bp/8.17/pr-6180 branch December 13, 2024 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts There is a conflict in the backported pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant