-
Notifications
You must be signed in to change notification settings - Fork 87
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
feat(metrics/family): add get
method to Family
#234
Conversation
@mxinden PTAL, thanks! |
seconding this addition, i would also suppport this change, and would like have the ability to avoid creating new metrics in a family when looking up the series for a particular label set. i'll cross-reference #244, which also introduces a new accessor to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the thorough patch.
What do you think of replacing the code below in Family::get_or_create
with a call to Family::get
?
if let Ok(metric) =
RwLockReadGuard::try_map(self.metrics.read(), |metrics| metrics.get(label_set))
{
return metric;
}
Also, please add a changelog entry.
Signed-off-by: Wenbo Zhang <[email protected]>
Signed-off-by: Wenbo Zhang <[email protected]>
@mxinden Addressed, PTAL, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Address comments in #230 (comment)