profiling

package
v1.9.4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(c Config)

Start initializes the pyroscope profiler with the given configuration.

Types

type Config

type Config struct {
	// Name is the name of the application.
	Name string `json:",optional,inherit"`
	// ServerAddr is the address of the profiling server.
	ServerAddr string
	// AuthUser is the username for basic authentication.
	AuthUser string `json:",optional"`
	// AuthPassword is the password for basic authentication.
	AuthPassword string `json:",optional"`
	// UploadRate is the duration for which profiling data is uploaded.
	UploadRate time.Duration `json:",default=15s"`
	// CheckInterval is the interval to check if profiling should start.
	CheckInterval time.Duration `json:",default=10s"`
	// ProfilingDuration is the duration for which profiling data is collected.
	ProfilingDuration time.Duration `json:",default=2m"`
	// CpuThreshold the collection is allowed only when the current service cpu > CpuThreshold
	CpuThreshold int64 `json:",default=700,range=[0:1000)"`

	// ProfileType is the type of profiling to be performed.
	ProfileType ProfileType
}

type ProfileType

type ProfileType struct {
	// Logger is a flag to enable or disable logging.
	Logger bool `json:",default=false"`
	// CPU is a flag to disable CPU profiling.
	CPU bool `json:",default=true"`
	// Goroutines is a flag to disable goroutine profiling.
	Goroutines bool `json:",default=true"`
	// Memory is a flag to disable memory profiling.
	Memory bool `json:",default=true"`
	// Mutex is a flag to disable mutex profiling.
	Mutex bool `json:",default=false"`
	// Block is a flag to disable block profiling.
	Block bool `json:",default=false"`
}

Jump to

Keyboard shortcuts

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