Standard library / runtime/pprof

pprof.Profiles()

Return known profiles in name order. The number of available profiles is not fixed. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func Profiles() []*Profile

Return Value

[]*Profile

Known profiles sorted by name.

Working Example

Example Snippetgo
package main
import (  "fmt"  "runtime/pprof"  "sort")
func main() {  var names []string  for _, p := range pprof.Profiles() {    names = append(names, p.Name())  }  fmt.Println(sort.StringsAreSorted(names) && len(names) > 0)}
Go Reference