-
Notifications
You must be signed in to change notification settings - Fork 11
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
[Sampler] Allow passing in a Proc to enable/disable the sampler. #134
Conversation
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.
Awesome change, a nit about deprecation
end | ||
|
||
def profile_sampler_enabled | ||
return false unless defined?(@profile_sampler_enabled) |
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.
return false unless defined?(@profile_sampler_enabled) |
You don't need that. If it's not defined then it's nil
. If it's nil
it isn't a Proc
. So you just return nil
which is close enough to false
.
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.
If it's okay, I would like to keep it as is. We enforce True/False/Proc
when setting. So if we read nil
and then try to set it back, it raises - which does not seem right.
8f0e196
to
1c3f41b
Compare
Going to squash the commits now |
…me 'paths' to 'targets', making it generic
1c3f41b
to
04a37af
Compare
Shipped this version to Core, everything is working as expected. |
Small improvements for the profile sampler:
profile_sampler_enabled
accepts a Proc now. The idea is to remove the sampler we have in Core and use this.paths
in the config totargets
. The idea is that the sampler can be use by Jobs too -- so it makes sense to make it generic.All changes are backwards compatible and should not break existing clients.