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

proposal: profiler: add CPUProfileRate option #1242

Closed
nsrip-dd opened this issue Apr 12, 2022 · 0 comments · Fixed by #1243
Closed

proposal: profiler: add CPUProfileRate option #1242

nsrip-dd opened this issue Apr 12, 2022 · 0 comments · Fixed by #1243
Assignees
Labels

Comments

@nsrip-dd
Copy link
Contributor

Calling runtime.SetCPUProfileRate with a non-zero value starts profiling at the given rate, if it hasn't already been called. This rate is effective until profiling is stopped (by setting the rate to 0). Because the profiler continually starts and stops CPU profiling, every round of CPU profiling after the first one will instead run with the default rate of 100 Hz. The user has no way to change this other than completely stopping our profiling. We should have a profiler option to give a rate that will be set each time before CPU profiling is started.

@nsrip-dd nsrip-dd self-assigned this Apr 12, 2022
nsrip-dd added a commit that referenced this issue Apr 12, 2022
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 added a commit that referenced this issue Apr 13, 2022
* profiler: add CPUProfileRate option

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant