pprof

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrServerDoneBeforeReady = errors.New("server terminated before being ready")

Functions

func NewServer

func NewServer(address string, logger Logger,
	options ...httpserver.Option) *httpserver.Server

NewServer creates a new Pprof server which will listen at the address specified.

Types

type Logger added in v0.8.0

type Logger interface {
	Info(msg string)
	Warn(msg string)
	Error(msg string)
}

Logger for the pprof http server.

type Runner added in v0.8.0

type Runner interface {
	Run(ctx context.Context, ready chan<- struct{}, done chan<- error)
}

Runner runs in a blocking manner.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service is a pprof http server service compatible with the dot/service.go interface.

func NewService

func NewService(config cfg.PprofConfig, logger Logger) *Service

NewService creates a pprof server service compatible with the dot/service.go interface.

func (*Service) Start

func (s *Service) Start() (err error)

Start starts the pprof server service.

func (*Service) Stop

func (s *Service) Stop() (err error)

Stop stops the pprof server service.

type Settings

type Settings struct {
	// ListeningAddress is the HTTP pprof server
	// listening address.
	ListeningAddress string
	// See runtime.SetBlockProfileRate
	// Set to 0 to disable profiling.
	BlockProfileRate int
	// See runtime.SetMutexProfileFraction
	// Set to 0 to disable profiling.
	MutexProfileRate int
}

Settings are the settings for the Pprof service.

func (*Settings) String

func (s *Settings) String() string

Jump to

Keyboard shortcuts

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