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
This proposal is based on #42502 and adds the ability to configure the sampling rate for CPU profiles.
At the moment it is possible to dynamically collect CPU profiles using the net/http/pprof package via go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30. In this example a 30 second CPU profile is collected.
Internally this call utilizes pprof.StartCPUProfile() which uses a hard coded sampling frequency of 100hz.
With #42502 being accepted it would be great if dynamically collected CPU profiles would also get the option to set the sampling frequency. This could be possible by adding an additional parameter besides seconds like hertz. hertz is just used as an example and input on better naming is always welcomed. This new parameter should be optional and if not set the CPU profile should use the default sampling rate of 100hz.
In the following example a CPU profile of 30 seconds with a sampling rate of 257hz is collected: go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30&hertz=257
The text was updated successfully, but these errors were encountered:
In my organization we are running multiple-micro services in a golang-based scaffold,I can clearly see such a feature be very important in debugging and in analyzing the efficiency of such services in specific architecture.. Looking forward to see how this proposal will develop in the forth-coming stages..
This proposal is based on #42502 and adds the ability to configure the sampling rate for CPU profiles.
At the moment it is possible to dynamically collect CPU profiles using the
net/http/pprof
package viago tool pprof http://localhost:6060/debug/pprof/profile?seconds=30
. In this example a 30 second CPU profile is collected.Internally this call utilizes
pprof.StartCPUProfile()
which uses a hard coded sampling frequency of 100hz.With #42502 being accepted it would be great if dynamically collected CPU profiles would also get the option to set the sampling frequency. This could be possible by adding an additional parameter besides
seconds
likehertz
.hertz
is just used as an example and input on better naming is always welcomed. This new parameter should be optional and if not set the CPU profile should use the default sampling rate of 100hz.In the following example a CPU profile of 30 seconds with a sampling rate of 257hz is collected:
go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30&hertz=257
The text was updated successfully, but these errors were encountered: