Skip to content

Add sample rate to SDK docs. #104

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

Merged
merged 2 commits into from
Mar 13, 2017
Merged

Add sample rate to SDK docs. #104

merged 2 commits into from
Mar 13, 2017

Conversation

bretthoerner
Copy link
Contributor

This is short and sweet, I didn't know what else to say.


.. sourcecode:: python

sample_rate = options.get('sample_rate') or 1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

if options.get('sample_rate') returns 0 this expression will evaluate to 1.0 instead, i think theres a legitimate case for setting sample_rate to 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Welp, you're the CEO now.


sample_rate = options.get('sample_rate') or 1.0

# assuming random() returns a value between 0.0 and 1.0
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe clarify 0 inclusive 1.0 exclusive, details might technically matter as ted pointed out in getsentry/raven-python#978

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, will do.

@bretthoerner bretthoerner merged commit 995dfb8 into master Mar 13, 2017
@bretthoerner bretthoerner deleted the sample-rate branch March 13, 2017 19:56
@github-actions github-actions bot locked and limited conversation to collaborators Dec 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants