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 wildcard key support #97

Merged
merged 4 commits into from
Oct 15, 2017
Merged

Conversation

mselee
Copy link
Contributor

@mselee mselee commented Oct 14, 2017

Hello,
This PR fixes #89 by adding two new methods for handling wildcard keys: get_metric_values/1 and get_metric_values/2.

@sourcelevel-bot
Copy link

Hello, @seleem1337! This is your first Pull Request that will be reviewed by Ebert, an automatic Code Review service. It will leave comments on this diff with potential issues and style violations found in the code as you push new commits. You can also see all the issues found on this Pull Request on its review page. Please check our documentation for more information.

defp to_exometer_key(metric_name) when is_list(metric_name), do: metric_name
defp to_exometer_key(metric_name) when is_binary(metric_name) do
String.split(metric_name, ".")
end

defp get_values(key) do
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this guard with is_list(key)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right. I'll add it now.

@jparise jparise merged commit 3bd3ef1 into pinterest:master Oct 15, 2017
@jparise
Copy link
Collaborator

jparise commented Oct 15, 2017

Nice work, @seleem1337, and thanks for the contribution!

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.

Get metric value by wildcard key
2 participants