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

Fix direct record methods on instrument to call unbind. #836

Merged
merged 1 commit into from
Feb 7, 2020

Conversation

bogdandrutu
Copy link
Member

No description provided.

bind(labelSet).add(delta);
BoundDoubleCounter boundDoubleCounter = bind(labelSet);
boundDoubleCounter.add(delta);
boundDoubleCounter.unbind();
Copy link
Contributor

Choose a reason for hiding this comment

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

Just thinking out loud...what would you think about having add return this so you could just write:

bind(labelSet).add(delta).unbind();

in one fluent call?

Copy link
Member Author

@bogdandrutu bogdandrutu Feb 7, 2020

Choose a reason for hiding this comment

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

I thought about this, but it is not that useful for users using bounds, but probably doesn't hurt. Happy to accept a followup PR to see how would look like:)

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, I agree. The bytecode probably ends up looking identical.

Copy link
Contributor

@jkwatson jkwatson left a comment

Choose a reason for hiding this comment

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

👍

@bogdandrutu bogdandrutu merged commit a9a31a0 into open-telemetry:master Feb 7, 2020
@bogdandrutu bogdandrutu deleted the usebound branch February 7, 2020 21:17
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.

2 participants