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

Add .get() to Family hashmap wrapper #130

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JaydenElliott
Copy link

@JaydenElliott JaydenElliott commented Mar 14, 2023

I have come across a few instances were I would like to check if a particular metric exists in the metric Family without creating a new entry if it doesn't. This PR simply exposes the HashMap::get() function to allow for match metric_family.get() type logic.

Let me know if there is anything else needed to get this change merged.

@mxinden
Copy link
Member

mxinden commented Mar 23, 2023

Thanks for the pull request.

In order for me to better understand the feature request, mind expanding on your concrete use-cases for this method?

@JaydenElliott
Copy link
Author

#131 (comment) describes the use case (allows me to access the metrics of a family to do comparisons against, or use to trigger logic without modifying the underlying data structure).

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