Standard library / runtime/pprof

pprof.Profile

A collection of stack samples or explicitly tracked resource stacks. Built-in profiles have special behavior; do not add records to them. Expected stdout: '1\n'.

Formal Syntax & Structure

go syntaxgo
type Profile struct {}

Working Example

Example Snippetgo
package main
import (  "fmt"  "runtime/pprof")
func main() {  var p *pprof.Profile = pprof.NewProfile("bytemind.resource")  p.Add("demo", 0)  defer p.Remove("demo")  fmt.Println(p.Count())}
Go Reference