pprof

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package pprof serves the /debug/pprof endpoint

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProbeCPU

func ProbeCPU() interface{ Stop() }

ProbeCPU is used like the following:

defer pprof.ProbeCPU.Stop()

When the caller reaches its function end, the defer executes Stop() that writes the file "cpu.pprof". To visualize "cpu.pprof" use the pprof tool:

cd ~/go
go get -u github.com/google/pprof
cd -
pprof -http=: cpu.pprof

func StartServer

func StartServer(port int)

StartServer starts a PProf server in background. Endpoints usage example:

curl http://localhost:6063/debug/pprof/allocs > allocs.pprof
pprof -http=: allocs.pprof

wget http://localhost:31415/debug/pprof/goroutine
pprof -http=: goroutine

wget http://localhost:31415/debug/pprof/heap
pprof -http=: heap

wget http://localhost:31415/debug/pprof/trace
pprof -http=: trace

Types

This section is empty.

Jump to

Keyboard shortcuts

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