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

Method GoTrace

internal/debug/api.go:117–124  ·  view source on GitHub ↗

GoTrace turns on tracing for nsec seconds and writes trace data to file.

(file string, nsec uint)

Source from the content-addressed store, hash-verified

115// GoTrace turns on tracing for nsec seconds and writes
116// trace data to file.
117func (h *HandlerT) GoTrace(file string, nsec uint) error {
118 if err := h.StartGoTrace(file); err != nil {
119 return err
120 }
121 time.Sleep(time.Duration(nsec) * time.Second)
122 h.StopGoTrace()
123 return nil
124}
125
126// BlockProfile turns on goroutine profiling for nsec seconds and writes profile data to
127// file. It uses a profile rate of 1 for most accurate information. If a different rate is

Callers

nothing calls this directly

Calls 3

StartGoTraceMethod · 0.95
StopGoTraceMethod · 0.95
SleepMethod · 0.80

Tested by

no test coverage detected