pprofutil

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultProfilePath = "/debug/pprof"
	DefaultProfilePort = 6060
)

Variables

This section is empty.

Functions

func Gather

func Gather(ctx context.Context, addr string, p Profile) (prof *profile.Profile, err error)

Gather downloads a profile from the address.

func GatherAll

func GatherAll(ctx context.Context, logger *zap.Logger, addr string) (map[Profile]*profile.Profile, error)

GatherAll downloads all profile types from address.

func GatherAllByPod

func GatherAllByPod(ctx context.Context, logger *zap.Logger, host string, pod corev1.Pod, forwardedPort int) (map[Profile]*profile.Profile, error)

func GetProfefePortByPod

func GetProfefePortByPod(pod corev1.Pod) int

func NewProfile

func NewProfile(r io.Reader) (*profile.Profile, error)

NewProfile parses the reader and returns a profile

Types

type Profile

type Profile int

Profile defines the types of profiles available.

const (
	// Allocs returns a sampling of all past memory allocations for addr at
	// addr/debug/pprof/allocs.
	Allocs Profile = iota
	// Block are stack traces that led to blocking on sync primitives.
	Block
	// Goroutine are stack traces of all current goroutines.
	Goroutine
	// Heap is a sampling of memory allocations of live objects.
	Heap
	// Mutex are stack traces of holders of contended mutexes.
	Mutex
	//ThreadCreate are Stack traces that led to the creation of new OS threads.
	ThreadCreate
	// CPUProfile returns a CPU profile for addr at addr/debug/pprof/profile?seconds=seconds.
	CPUProfile
)

func Profiles

func Profiles() []Profile

Profiles returns all the profile types possible to Gather.

func (Profile) String

func (p Profile) String() string

Jump to

Keyboard shortcuts

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