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
On the other hand for mutex and block profiling, it expects us to set the block/fraction rate in our program before calling profiling.
My doubt is why mutex and block profiling have different behaviour ?
If we can set the rate any time then similar to cpu profiling, block/mutex profiling can also be implemented like
go tool pprof http://localhost:6060/debug/pprof/block?seconds=30&rate=1
Where internally we can call SetBlockProfileRate/SetMutexProfileFraction before starting profile and after profile interval (eg. 30 seconds) when profiling finishes then we can reset it to 0.
This different implementation made me question why is there a difference in the profiling technique, is it expected from us to set profile rate at the start of the program, if not then why is it not implemented similar to the cpu.
The text was updated successfully, but these errors were encountered:
Hello @nidhi-ag, I see that you have raised this question in golang-nuts. I think that is the right place to discuss this.
Unlike other projects, we do not use the issue tracker for questions such as these. It is only used for bugs and feature proposals. I will close this issue, but please feel free to ask it in any of these forums below:
For CPU profiling, the rate of profiling is being set internally at start of the call and reset at the end of the call. So it goes like this
CPUProfiling() {
StartCPUProfile() // internally calls SetCPUProfileRate(100)
sleep(seconds)
StopCPUProfile () // internally calls SetCPUProfileRate(0)
}
On the other hand for mutex and block profiling, it expects us to set the block/fraction rate in our program before calling profiling.
My doubt is why mutex and block profiling have different behaviour ?
If we can set the rate any time then similar to cpu profiling, block/mutex profiling can also be implemented like
go tool pprof http://localhost:6060/debug/pprof/block?seconds=30&rate=1
Where internally we can call SetBlockProfileRate/SetMutexProfileFraction before starting profile and after profile interval (eg. 30 seconds) when profiling finishes then we can reset it to 0.
This different implementation made me question why is there a difference in the profiling technique, is it expected from us to set profile rate at the start of the program, if not then why is it not implemented similar to the cpu.
The text was updated successfully, but these errors were encountered: