pprofile

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package pprofile encapsulates pprof functionality.

Index

Constants

View Source
const (
	ModeOff       = "off"
	ModeCPU       = "cpu"
	ModeMem       = "mem"
	ModeBlock     = "block"
	ModeMutex     = "mutex"
	ModeTrace     = "trace"
	ModeThread    = "thread"
	ModeGoroutine = "goroutine"
)

Available pprof modes.

Variables

View Source
var OptMode = options.NewString(
	"debug.pprof",
	&options.Flag{},
	ModeOff,
	validMode,
	"pprof profiling mode",
	`Configure pprof profiling, writing output to SQ_CONFIG/pprof. Allowed modes are:

  `+strings.Join(modes, ", "),
)

Functions

func Modes

func Modes() []string

Modes returns the allowed pprof modes, including ModeNode.

func Start

func Start(ctx context.Context, mode, pprofDir string) (stop func(), err error)

Start starts pprof profiling, writing output to pprofDir, as well as a copy to pprofDir/history. If err is nil, the caller must invoke the returned stop func to stop profiling, typically in a defer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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