pprof

package
v0.73.7 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Level       encoding.LogLevel `long:"level"`
	Enabled     bool              `long:"enabled"`
	Port        uint16            `long:"port"`
	ProfilesDir string            `long:"profiles-dir"`
	// To include every blocking event in the profile, pass rate = 1.
	// To turn off profiling entirely, pass rate <= 0.
	BlockProfileRate int `long:"block-profile-rate"`
	// To turn off profiling entirely, pass rate 0.
	// To just read the current rate, pass rate < 0.
	// (For n>1 the details of sampling may change.)
	MutexProfileFraction int `long:"mutex-profile-fraction"`
	// Write the profiles to disk every WriteEvery interval
	WriteEvery encoding.Duration `description:"write pprof files at this interval; if 0 only write on shutdown" long:"write-every"`
}

Config represent the configuration of the pprof package.

func NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig create a new default configuration for the pprof handler.

type Pprofhandler

type Pprofhandler struct {
	Config
	// contains filtered or unexported fields
}

Pprofhandler is handling pprof profile management.

func New

func New(log *logging.Logger, config Config) (*Pprofhandler, error)

New creates a new pprof handler.

func (*Pprofhandler) ReloadConf

func (p *Pprofhandler) ReloadConf(cfg Config)

ReloadConf update the configuration of the pprof package.

func (*Pprofhandler) Stop

func (p *Pprofhandler) Stop() error

Stop is meant to be use to stop the pprof profile, should be use with defer probably.

Jump to

Keyboard shortcuts

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