-
Notifications
You must be signed in to change notification settings - Fork 211
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
fix: reduce number of anypb.New invoke when enriching flows #270
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nddq
changed the title
fix: reduce number of
fix: reduce number of anypb.New invoke when calling toFlow
Apr 16, 2024
anypb.New
invoke when calling toFlow
nddq
changed the title
fix: reduce number of anypb.New invoke when calling toFlow
fix: reduce number of anypb.New invoke when enriching flows
Apr 22, 2024
rbtr
reviewed
Apr 24, 2024
anubhabMajumdar
approved these changes
Apr 24, 2024
nddq
added a commit
that referenced
this pull request
May 6, 2024
# Description Reducing the number of `anypb.New` calls by making all the flow enrichment functions that is invoking `anypb.New` such as `AddPacketSize` and `AddTCPFlags`, which we are calling separately, into functions that accept `RetinaMetadata` struct as an additional param, therefore allowing us to create a single flow's metadata struct, adding data into it, and then calling `anypb.New` once via `AddRetinaMetadata` at the end when adding the metadata struct to its flow. ## Related Issue If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request. ## Checklist - [x] I have read the [contributing documentation](https://retina.sh/docs/contributing). - [x] I signed and signed-off the commits (`git commit -S -s ...`). See [this documentation](https://docs.github.com/en/authentication/managing-commit-signature-verification/about-commit-signature-verification) on signing commits. - [x] I have correctly attributed the author(s) of the code. - [x] I have tested the changes locally. - [x] I have followed the project's style guidelines. - [x] I have updated the documentation, if necessary. - [x] I have added tests, if applicable. ## Screenshots (if applicable) or Testing Completed Please add any relevant screenshots or GIFs to showcase the changes made. ## Additional Notes Add any additional notes or context about the pull request here. --- Please refer to the [CONTRIBUTING.md](../CONTRIBUTING.md) file for more information on how to contribute to this project.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Reducing the number of
anypb.New
calls by making all the flow enrichment functions that is invokinganypb.New
such asAddPacketSize
andAddTCPFlags
, which we are calling separately, into functions that acceptRetinaMetadata
struct as an additional param, therefore allowing us to create a single flow's metadata struct, adding data into it, and then callinganypb.New
once viaAddRetinaMetadata
at the end when adding the metadata struct to its flow.Related Issue
If this pull request is related to any issue, please mention it here. Additionally, make sure that the issue is assigned to you before submitting this pull request.
Checklist
git commit -S -s ...
). See this documentation on signing commits.Screenshots (if applicable) or Testing Completed
Please add any relevant screenshots or GIFs to showcase the changes made.
Additional Notes
Add any additional notes or context about the pull request here.
Please refer to the CONTRIBUTING.md file for more information on how to contribute to this project.