-
Notifications
You must be signed in to change notification settings - Fork 88
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
Telemetry module for Swift #369
Conversation
private var telemetryTimer: Timer? | ||
|
||
func start() { | ||
guard enable, !started, sampleRate != 0.0 else { return } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe sampleRate > 0.0 && sampleRate <= 1.0
?
var over = false | ||
telemetryQueue.sync { | ||
over = queue.count < maxQueueSize | ||
} | ||
return over |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think value determined is if you are "under" max queue size. Should that variable be changed to under
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would make more sense. I like the guard clause but the inverted logic got me a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall.
I would add some better protection to the sample rate by given it a bounds like > 0.0 and <= 1.0 if that's the intension.
No description provided.