You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most clients should use the runtime/pprof package or the testing package's -test.cpuprofile flag instead of calling SetCPUProfileRate directly.
However, the -test.cpuprofile flag does not allow you to set the CPU profile rate, only the name of the file to which the profile should be written out to. The sentence quoted above should probably be removed.
The text was updated successfully, but these errors were encountered:
The docs are correct. Although the testing package's -test.cpuprofile flag is not a complete replacement for runtime.SetCPUProfileRate, it does essentially call the function with a fixed value, namely 100. So we are recommending that people use -test.cpuprofile rather than write their code to call runtime.SetCPUProfileRate.
Note that the same is true of the runtime/pprof package that is also mentioned: it calls runtime.SetCPUProfileRate, but always passes either 100 or 0.
The docstring for
SetCPUProfileRate
states,However, the
-test.cpuprofile
flag does not allow you to set the CPU profile rate, only the name of the file to which the profile should be written out to. The sentence quoted above should probably be removed.The text was updated successfully, but these errors were encountered: