pprof

package
v0.0.0-...-61b053f Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBlockProfileRateNegative = errors.New("block profile rate cannot be negative")
	ErrMutexProfileRateNegative = errors.New("mutex profile rate cannot be negative")
)

Functions

func New

func New(settings Settings) (server *httpserver.Server, err error)

New creates a new Pprof server and configure profiling with the settings given. It returns an error if one of the settings is not valid.

Types

type Settings

type Settings struct {
	// Enabled can be false or true.
	// It defaults to false.
	Enabled *bool
	// See runtime.SetBlockProfileRate
	// Set to 0 to disable profiling.
	BlockProfileRate *int
	// See runtime.SetMutexProfileFraction
	// Set to 0 to disable profiling.
	MutexProfileRate *int
	// HTTPServer contains settings to configure
	// the HTTP server serving pprof data.
	HTTPServer httpserver.Settings
}

Settings are the settings for the Pprof service.

func (Settings) Copy

func (s Settings) Copy() (copied Settings)

func (*Settings) OverrideWith

func (s *Settings) OverrideWith(other Settings)

func (*Settings) Read

func (s *Settings) Read(r *reader.Reader) (err error)

func (*Settings) SetDefaults

func (s *Settings) SetDefaults()

func (Settings) String

func (s Settings) String() string

func (Settings) ToLinesNode

func (s Settings) ToLinesNode() (node *gotree.Node)

func (Settings) Validate

func (s Settings) Validate() (err error)

Jump to

Keyboard shortcuts

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