BlockProfile turns on goroutine profiling for nsec seconds and writes profile data to file. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually.
(file string, nsec uint)
| 127 | // file. It uses a profile rate of 1 for most accurate information. If a different rate is |
| 128 | // desired, set the rate and write the profile manually. |
| 129 | func (*HandlerT) BlockProfile(file string, nsec uint) error { |
| 130 | runtime.SetBlockProfileRate(1) |
| 131 | time.Sleep(time.Duration(nsec) * time.Second) |
| 132 | defer runtime.SetBlockProfileRate(0) |
| 133 | return writeProfile("block", file) |
| 134 | } |
| 135 | |
| 136 | // SetBlockProfileRate sets the rate of goroutine block profile data collection. |
| 137 | // rate 0 disables block profiling. |
nothing calls this directly
no test coverage detected