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).
| 19 | // - "sample" counts the number of function calls. |
| 20 | // - "cpu" records the time spent in function calls (in nanoseconds). |
| 21 | type 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. |
nothing calls this directly
no outgoing calls
no test coverage detected