Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultBlockProfileRate = 10_000_000 // ns DefalutMutexProfileRate = 100 // 1/100 events )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BlockConfig ¶
type BlockConfig struct {
Enabled bool `json:"enabled"`
Path string `json:"path"`
// SetBlockProfileRate controls the fraction of goroutine blocking events
// That are reported in the blocking profile. The profiler aims to sample
// An average of one blocking event per rate nanoseconds spent blocked.
//
// To include every blocking event in the profile, pass rate = 1.
//
// 0 means the default rate (10_000_000 ns), see runtime.SetBlockProfileRate.
Rate int `json:"rate"`
}
type Config ¶
type Config struct {
Enabled bool `json:"enabled"`
CPU CPUConfig `json:"cpu"`
Memory MemoryConfig `json:"memory"`
Block BlockConfig `json:"block"`
Mutex MutexConfig `json:"mutex"`
}
Config specifies a profiling configuration.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default profiling config.
func ReadConfig ¶
ReadConfig reads a profiling config from a JSON or YAML file.
type MemoryConfig ¶
type MemoryConfig struct {
Enabled bool `json:"enabled"`
Path string `json:"path"`
// Rate controls the fraction of memory allocations that are recorded
// And reported in the memory profile. The profiler aims to sample
// An average of one allocation per MemProfileRate bytes allocated.
//
// To include every allocated block in the profile, set MemProfileRate to 1.
//
// 0 means the default rate (512 kb), see runtime.SetMemProfileRate.
Rate int `json:"rate"`
}
type MutexConfig ¶
type MutexConfig struct {
Enabled bool `json:"enabled"`
Path string `json:"path"`
// Rate controls the fraction of mutex contention events that are reported
// In the mutex profile. On average 1/rate events are reported.
//
// 0 means the default rate (1/100), see runtime.SetMutexProfileFraction.
Rate int `json:"rate"`
}
Click to show internal directories.
Click to hide internal directories.