Skip to content
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

profiler: add CPUProfileRate option #1243

Merged
merged 3 commits into from
Apr 13, 2022
Merged

Conversation

nsrip-dd
Copy link
Contributor

If a user wants to use a CPU profiling rate other than the default, they
would need to be able to set the rate before each round of profiling to
avoid having their rate overridden by runtime/pprof.StartCPUProfile
after the first round. This is currently not possible, so add an option
that we can use internally to set the rate each time.

Using this option will cause a spurious warning every time profiling
starts. The warning is annoying, but setting the rate will work as
intended.

Fixes #1242

If a user wants to use a CPU profiling rate other than the default, they
would need to be able to set the rate before each round of profiling to
avoid having their rate overridden by runtime/pprof.StartCPUProfile
after the first round. This is currently not possible, so add an option
that we can use internally to set the rate each time.

Using this option will cause a spurious warning every time profiling
starts. The warning is annoying, but setting the rate will work as
intended.

Fixes #1242
@nsrip-dd nsrip-dd requested a review from a team as a code owner April 12, 2022 13:25
@nsrip-dd nsrip-dd added this to the 1.38.0 milestone Apr 12, 2022
@nsrip-dd nsrip-dd merged commit 3e453c4 into v1 Apr 13, 2022
@nsrip-dd nsrip-dd deleted the nick.ripley/profiler-set-cpu-rate branch April 13, 2022 12:21
@felixge
Copy link
Member

felixge commented Apr 19, 2022

This is great, thanks @nsrip-dd !

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.

proposal: profiler: add CPUProfileRate option
3 participants