[8.15](backport #40081) [debugPrintProcessor]: exit directly when log doesn't have debug level enabled #40124
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed commit message
This PR is the aftermath of profiling the netflow integration test of this PR (PS: the pcap I used as input is ~25MB thus I won't include it in beats repo)
So this is the cpu profile flamegraph before the commit of this PR
As we can see
debugPrintProcessor
is invoked and we pay the "performance" price of encoding every event in json even when our log isn't set up with DEBUG level.The respective cpu profile flamegraph after this PR with debugPrintProcessor still being there but exiting directly when log DEBUG is not enabled
Extracting the average EPS of the aformentioned netflow integration tested on my local macbook with a local ES inside a container
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
N/A
Author's Checklist
N/A
How to test this PR locally
Help get this PR merged or clone it and apply this small commit there 🙂
run go profiler against TestNetFlowIntegration
Related issues
Use cases
N/A
Screenshots
Look at description
Logs
N/A
This is an automatic backport of pull request #40081 done by Mergify.