MCPcopy Create free account
hub / github.com/dispatchrun/wzprof / StartProfile

Method StartProfile

cpu.go:72–83  ·  view source on GitHub ↗

StartProfile begins recording the CPU profile. The method returns a boolean to indicate whether starting the profile succeeded (e.g. false is returned if it was already started).

()

Source from the content-addressed store, hash-verified

70// to indicate whether starting the profile succeeded (e.g. false is returned if
71// it was already started).
72func (p *CPUProfiler) StartProfile() bool {
73 p.mutex.Lock()
74 defer p.mutex.Unlock()
75
76 if p.counts != nil {
77 return false // already started
78 }
79
80 p.counts = make(stackCounterMap)
81 p.start = time.Now()
82 return true
83}
84
85// StopProfile stops recording and returns the CPU profile. The method returns
86// nil if recording of the CPU profile wasn't started.

Callers 4

NewHandlerMethod · 0.95
BenchmarkCPUProfilerOnFunction · 0.80
TestCPUProfilerTimeFunction · 0.80
runMethod · 0.80

Calls

no outgoing calls

Tested by 2

BenchmarkCPUProfilerOnFunction · 0.64
TestCPUProfilerTimeFunction · 0.64