Refactor context creation#433
Merged
shreyamalpani merged 4 commits intojordan.gonzalez/bottlecap/universal-instrumentationfrom Nov 5, 2024
Merged
Conversation
duncanista
reviewed
Nov 4, 2024
| /// `Context` is created and added to the buffer. | ||
| /// Creates a new `Context` and adds it to the buffer. | ||
| /// | ||
| #[allow(clippy::ptr_arg)] |
Contributor
Author
There was a problem hiding this comment.
I could change it to &str instead of &String, but I wasn't sure if it is better to keep it consistent with the other functions using &String
pub fn create_context(&mut self, request_id: &str) {
self.insert(Context::new(request_id.to_owned(), 0.0, 0.0, 0, None));
}
Contributor
There was a problem hiding this comment.
I just don't think it's worth passing a reference if we are gonna clone inside
Contributor
There was a problem hiding this comment.
It doesn't have to be consistent because in the other ones you're searching, and in this one you're keeping the value.
Contributor
Author
There was a problem hiding this comment.
I see, thanks!
duncanista
approved these changes
Nov 5, 2024
376318f
into
jordan.gonzalez/bottlecap/universal-instrumentation
duncanista
added a commit
that referenced
this pull request
Nov 15, 2024
* create context on invoke event * update tests * clippy fixes * remove `allow(clippy::ptr_arg)` --------- Co-authored-by: jordan gonzález <30836115+duncanista@users.noreply.github.com>
duncanista
added a commit
that referenced
this pull request
Nov 19, 2024
* create context on invoke event * update tests * clippy fixes * remove `allow(clippy::ptr_arg)` --------- Co-authored-by: jordan gonzález <30836115+duncanista@users.noreply.github.com>
This file contains hidden or 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
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.
What does this PR do?
Creates the context for a request_id on receiving the Invoke event, and removes this logic from other events since the Invoke event is always received first.