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

ref: Forward set_transaction to a running Transaction #433

Merged
merged 1 commit into from
Feb 14, 2022

Conversation

Swatinem
Copy link
Member

@Swatinem Swatinem commented Feb 11, 2022

A call to Scope::set_transaction will now also forward the given name to the currently running performance monitoring transaction to override the name it was started with.

@codecov-commenter
Copy link

Codecov Report

Merging #433 (c6306fa) into master (4a162ef) will increase coverage by 0.04%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##           master     #433      +/-   ##
==========================================
+ Coverage   80.48%   80.53%   +0.04%     
==========================================
  Files          73       73              
  Lines        8252     8288      +36     
==========================================
+ Hits         6642     6675      +33     
- Misses       1610     1613       +3     

Copy link
Contributor

@flub flub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm but please commit with a description of why and what. the title made no sense until after i understood the code, and but really the why is important to describe.

@@ -160,6 +160,17 @@ impl Scope {
/// Sets the transaction.
pub fn set_transaction(&mut self, transaction: Option<&str>) {
self.transaction = transaction.map(Arc::from);
if let Some(name) = transaction {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: if you're switching to if let i think it makes more sense to move line 162 into this block as well to keep the logic the same which make reading easier.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line above should explicitly set None as well though

@Swatinem Swatinem merged commit 92be25b into master Feb 14, 2022
@Swatinem Swatinem deleted the ref/set-transaction branch February 14, 2022 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants