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

Broaden support for pre-computing metric names #62

Merged
merged 1 commit into from
Dec 22, 2016

Conversation

pguillory
Copy link
Collaborator

Profiling showed a significant amount of time being spent in
Utils.name_to_exometer and to_atom_list. One solution is to convert static
metric names to lists ahead of time, or otherwise manually assembling the
desired list form of the metric. Updater.timer supports this pattern by
avoiding a double conversion, but counter/etc do not. This change should
add support to all metric types.

There is a bit of redundancy now in that Updater.timer still does its check. I
haven't removed it because I'm not sure if there was some reason we always
wanted timer metric names converted in the calling process, rather than in the
registered Updater process.

Profiling showed a significant amount of time being spent in
Utils.name_to_exometer and to_atom_list. One solution is to convert static
metric names to lists ahead of time, or otherwise manually assembling the
desired list form of the metric. Updater.timer supports this pattern by
avoiding a double conversion, but counter/etc do not. This change should
add support to all metric types.

There is a bit of redundancy now in that Updater.timer still does its check. I
haven't removed it because I'm not sure if there was some reason we always
wanted timer metric names converted in the calling process, rather than in the
registered Updater process.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 91.852% when pulling 0f97ae3 on pguillory:precompute into d9adc56 on pinterest:master.

@@ -1,4 +1,9 @@
defmodule Elixometer.Utils do
# Name may already have been converted elsewhere.
def name_to_exometer(_metric_type, name) when is_list(name) do
Copy link
Collaborator

Choose a reason for hiding this comment

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

careful; someone could define metrics with single quotes.

@scohen scohen merged commit 62d7b9e into pinterest:master Dec 22, 2016
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