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

Struct CPUProfiler

cpu.go:21–30  ·  view source on GitHub ↗

CPUProfiler is the implementation of a performance profiler recording samples of CPU time spent in functions of a WebAssembly module. The profiler generates samples of two types: - "sample" counts the number of function calls. - "cpu" records the time spent in function calls (in nanoseconds).

Source from the content-addressed store, hash-verified

19// - "sample" counts the number of function calls.
20// - "cpu" records the time spent in function calls (in nanoseconds).
21type CPUProfiler struct {
22 p *Profiling
23 mutex sync.Mutex
24 counts stackCounterMap
25 frames []cpuTimeFrame
26 traces []stackTrace
27 time func() int64
28 start time.Time
29 host bool
30}
31
32// CPUProfilerOption is a type used to represent configuration options for
33// CPUProfiler instances created by NewCPUProfiler.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected