1
0
mirror of https://github.com/DataDog/go-profiler-notes.git synced 2025-07-15 23:54:16 +02:00

Add CPU profiler section

This commit is contained in:
Felix Geisendörfer
2021-09-09 23:46:41 +02:00
parent fd511c528d
commit 6b9adbfc74
12 changed files with 218 additions and 37 deletions

24
guide/cpu-utilization.go Normal file
View File

@ -0,0 +1,24 @@
// +build ignore
package main
import (
"os"
"runtime/pprof"
"time"
)
func main() {
pprof.StartCPUProfile(os.Stdout)
defer pprof.StopCPUProfile()
go cpuHog()
go cpuHog()
time.Sleep(time.Second)
}
func cpuHog() {
for {
}
}