pprof

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2021 License: MPL-2.0 Imports: 9 Imported by: 48

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CPUProfile

func CPUProfile(ctx context.Context, sec int) ([]byte, map[string]string, error)

CPUProfile generates a CPU Profile for a given duration

func Cmdline

func Cmdline() ([]byte, map[string]string, error)

Cmdline responds with the running program's command line, with arguments separated by NUL bytes.

func IsErrProfileNotFound

func IsErrProfileNotFound(err error) bool

IsErrProfileNotFound returns whether the error is due to a pprof profile being invalid

func NewErrProfileNotFound

func NewErrProfileNotFound(profile string) error

NewErrProfileNotFound returns a new error caused by a pprof.Lookup profile not being found

func Profile

func Profile(profile string, debug, gc int) ([]byte, map[string]string, error)

Profile generates a pprof.Profile report for the given profile name see runtime/pprof/pprof.go for available profiles.

func Trace

func Trace(ctx context.Context, sec int) ([]byte, map[string]string, error)

Trace runs a trace profile for a given duration

Types

type ReqType

type ReqType string
const (
	CmdReq    ReqType = "cmdline"
	CPUReq    ReqType = "cpu"
	TraceReq  ReqType = "trace"
	LookupReq ReqType = "lookup"

	ErrProfileNotFoundPrefix = "Pprof profile not found profile:"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL