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

Method MutexProfile

internal/debug/api.go:150–155  ·  view source on GitHub ↗

MutexProfile turns on mutex profiling for nsec seconds and writes profile data to file. It uses a profile rate of 1 for most accurate information. If a different rate is desired, set the rate and write the profile manually.

(file string, nsec uint)

Source from the content-addressed store, hash-verified

148// It uses a profile rate of 1 for most accurate information. If a different rate is
149// desired, set the rate and write the profile manually.
150func (*HandlerT) MutexProfile(file string, nsec uint) error {
151 runtime.SetMutexProfileFraction(1)
152 time.Sleep(time.Duration(nsec) * time.Second)
153 defer runtime.SetMutexProfileFraction(0)
154 return writeProfile("mutex", file)
155}
156
157// SetMutexProfileFraction sets the rate of mutex profiling.
158func (*HandlerT) SetMutexProfileFraction(rate int) {

Callers

nothing calls this directly

Calls 3

writeProfileFunction · 0.85
SleepMethod · 0.80

Tested by

no test coverage detected