Skip to content

Conversation

@yaro-m
Copy link

@yaro-m yaro-m commented Mar 30, 2018

Add ability to set the global sample rate

@yaro-m yaro-m force-pushed the global-sample-rate branch from 602c0fc to dc7ee61 Compare March 30, 2018 15:50
lib/statix.ex Outdated
def transmit(conn, type, key, val, options)
when (is_binary(key) or is_list(key)) and is_list(options) do
sample_rate = Keyword.get(options, :sample_rate)
sample_rate = Keyword.get(options, :sample_rate, Application.get_env(:statix, :sample_rate))
Copy link
Owner

Choose a reason for hiding this comment

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

I think instead of fetching the value from env each call we should read it once and store in the connection struct.

Copy link
Author

Choose a reason for hiding this comment

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

Looks reasonable. Let me update PR and see if I'm on right track.

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