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

Method StopCPUProfile

internal/debug/api.go:101–113  ·  view source on GitHub ↗

StopCPUProfile stops an ongoing CPU profile.

()

Source from the content-addressed store, hash-verified

99
100// StopCPUProfile stops an ongoing CPU profile.
101func (h *HandlerT) StopCPUProfile() error {
102 h.mu.Lock()
103 defer h.mu.Unlock()
104 pprof.StopCPUProfile()
105 if h.cpuW == nil {
106 return errors.New("CPU profiling not in progress")
107 }
108 log.Info("Done writing CPU profile", "dump", h.cpuFile)
109 h.cpuW.Close()
110 h.cpuW = nil
111 h.cpuFile = ""
112 return nil
113}
114
115// GoTrace turns on tracing for nsec seconds and writes
116// trace data to file.

Callers 2

CpuProfileMethod · 0.95
ExitFunction · 0.45

Calls 4

LockMethod · 0.80
UnlockMethod · 0.80
InfoMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected