Skip to content

Global sample rate#22

Open
yaro-m wants to merge 3 commits intolexmag:masterfrom
yaro-m:global-sample-rate
Open

Global sample rate#22
yaro-m wants to merge 3 commits intolexmag:masterfrom
yaro-m:global-sample-rate

Conversation

@yaro-m
Copy link
Copy Markdown

@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
Comment thread 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
Copy Markdown
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
Copy Markdown
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