StartBlockingProfile starts blocking profiling. rate 0 disables block profiling.
(rate int, file string)
| 140 | // StartBlockingProfile starts blocking profiling. |
| 141 | // rate 0 disables block profiling. |
| 142 | func (h *HandlerT) StartBlockingProfile(rate int, file string) error { |
| 143 | h.mu.Lock() |
| 144 | defer h.mu.Unlock() |
| 145 | |
| 146 | if h.blockingW != nil { |
| 147 | return errors.New("Blocking profiling already in progress") |
| 148 | } |
| 149 | f, err := os.Create(file) |
| 150 | if err != nil { |
| 151 | return err |
| 152 | } |
| 153 | h.blockingFile = file |
| 154 | h.blockingW = f |
| 155 | |
| 156 | runtime.SetBlockProfileRate(rate) |
| 157 | return nil |
| 158 | } |
| 159 | |
| 160 | // StopBlockProfile stops an ongoing blocking profile |
| 161 | func (h *HandlerT) StopBlockingProfile() error { |
nothing calls this directly
no test coverage detected