MCPcopy Create free account
hub / github.com/CPChain/chain / StopBlockingProfile

Method StopBlockingProfile

internal/profile/handler.go:161–178  ·  view source on GitHub ↗

StopBlockProfile stops an ongoing blocking profile

()

Source from the content-addressed store, hash-verified

159
160// StopBlockProfile stops an ongoing blocking profile
161func (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.

Callers

nothing calls this directly

Calls 4

writeBlockProfileFunction · 0.85
SetBlockProfileRateMethod · 0.80
InfoMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected