pprof

package
v0.0.0-...-75ec8e3 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT 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 {
	// HTTP server mode
	HTTPAddr string // HTTP server address (e.g., ":6060", "localhost:6060")

	// File-based mode
	CPUProfile       string // Path to write CPU profile file
	HeapProfile      string // Path to write heap profile file
	GoroutineProfile string // Path to write goroutine profile file
	BlockProfile     string // Path to write block profile file
	MutexProfile     string // Path to write mutex profile file
	TraceProfile     string // Path to write execution trace file

	// Block and mutex profiling rates
	BlockProfileRate     int // Sample 1/n events (default: 1)
	MutexProfileFraction int // Sample 1/n events (default: 1)
}

Config holds the pprof configuration

type Handler

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

Handler manages pprof profiling

func NewHandler

func NewHandler(config Config) *Handler

NewHandler creates a new pprof handler with the given configuration

func (*Handler) Start

func (h *Handler) Start() error

Start begins profiling based on the configuration

func (*Handler) Stop

func (h *Handler) Stop() error

Stop stops profiling and writes profile files

Jump to

Keyboard shortcuts

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