Golang runtime/pprof.Profiles() function and Profile type example

package runtime/pprof

Golang runtime/pprof.Profiles() function and Profile type usage example

 package main

 import (
 "fmt"
 "runtime/pprof"
 )

 func main() {

 profiles := pprof.Profiles()

 for k, v := range profiles {
 fmt.Println(k, v)
 }
 }

0 &{block {0 0} map[] 0x4550d0 0x455120}

1 &{goroutine {0 0} map[] 0x454a80 0x454ab0}

2 &{heap {0 0} map[] 0x452410 0x452460}

3 &{threadcreate {0 0} map[] 0x4549a0 0x4549f0}

Reference :

http://golang.org/pkg/runtime/pprof/#Profiles

http://golang.org/pkg/runtime/pprof/#Profile

Advertisement