StopBlockProfile stops an ongoing blocking profile
()
| 159 | |
| 160 | // StopBlockProfile stops an ongoing blocking profile |
| 161 | func (h *HandlerT) StopBlockingProfile() error { |
| 162 | if h.blockingW == nil { |
| 163 | return ProfilingNotInProgressError |
| 164 | } |
| 165 | if err := writeBlockProfile(h.blockingW); err == nil { |
| 166 | log.Info("Done writing blocking profile", "dump", h.blockingFile) |
| 167 | } else { |
| 168 | return &profilingDumpError{"block", err} |
| 169 | } |
| 170 | |
| 171 | h.blockingW.Close() |
| 172 | h.blockingW = nil |
| 173 | h.blockingFile = "" |
| 174 | |
| 175 | runtime.SetBlockProfileRate(0) |
| 176 | |
| 177 | return nil |
| 178 | } |
| 179 | |
| 180 | // StartMemProfile starts the memory profiling rate that controls the fraction of memory allocations |
| 181 | // that are recorded and reported in the memory profile. |
nothing calls this directly
no test coverage detected