pprof

package
v2.0.0-...-c87de9c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

README

Use the pprof tool

Then use the pprof tool to look at the heap profile:

go tool pprof http://localhost:9999/debug/pprof/heap

Or to look at a 30-second CPU profile:

go tool pprof http://localhost:9999/debug/pprof/profile

Or to look at the goroutine blocking profile, after calling runtime.SetBlockProfileRate in your program:

go tool pprof http://localhost:9999/debug/pprof/block

Or to collect a 5-second execution trace:

wget http://localhost:9999/debug/pprof/trace?seconds=5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Default = StdConfig().Build()
)

Functions

This section is empty.

Types

type Config

type Config struct {
}

func DefaultConfig

func DefaultConfig() *Config

func StdConfig

func StdConfig() *Config

func (*Config) Build

func (c *Config) Build() *PProf

func (*Config) Path

func (c *Config) Path() string

type PProf

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

func (*PProf) Name

func (pp *PProf) Name() string

func (*PProf) Serve

func (pp *PProf) Serve(ctx context.Context) error

func (*PProf) Shutdown

func (pp *PProf) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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