pprof

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 10 Imported by: 13

Documentation

Overview

Package pprof enables use of pprof in Cilium

Index

Constants

View Source
const (
	// Pprof is the flag to enable the registration of pprof HTTP handlers
	Pprof = "pprof"

	// PprofAddress is the flag to set the address that pprof listens on
	PprofAddress = "pprof-address"

	// PprofPort is the flag to set the port that pprof listens on
	PprofPort = "pprof-port"

	// PprofMutexProfileFraction is the flag to enable mutex contention profiling and set the fraction of sampled events.
	// Set to 1 to sample all events.
	PprofMutexProfileFraction = "pprof-mutex-profile-fraction"

	// PprofBlockProfileRate is the flag to enable goroutine blocking profiling and set the rate of sampled events in nanoseconds.
	// Set to 1 to sample all events.
	// This setting is not recommended for production due to performance overhead.
	PprofBlockProfileRate = "pprof-block-profile-rate"
)

Variables

This section is empty.

Functions

func Cell

func Cell[Cfg cell.Flagger](cfg Cfg) cell.Cell

Cell creates the cell for pprof, that registers its HTTP handlers to serve profiling data in the format expected by the pprof visualization tool.

func Enable deprecated

func Enable(logger *slog.Logger, host string, port int)

Enable runs an HTTP server to serve the pprof API

Deprecated: use pprof.Cell() instead.

Types

type Config

type Config struct {
	Pprof                     bool
	PprofAddress              string
	PprofPort                 uint16
	PprofMutexProfileFraction int
	PprofBlockProfileRate     int
}

Config contains the configuration for the pprof cell.

func (Config) Flags

func (def Config) Flags(flags *pflag.FlagSet)

type Server

type Server interface {
	// Port returns the port at which the server is listening
	Port() int
}

Jump to

Keyboard shortcuts

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