Documentation
¶
Overview ¶
Package pproflogging for pproflogging helper functions.
Index ¶
- Constants
- Variables
- func DumpPem(bs []byte, types string, wrt *os.File) error
- func LoadProfileConfig(ctx context.Context, ppconfigss string) (map[ProfileName]*ProfileConfig, error)
- func StartProfileBuffers(ctx context.Context)
- func StopProfileBuffers(ctx context.Context)
- type ProfileConfig
- type ProfileConfigs
- type ProfileName
- type Writer
Constants ¶
const ( // DefaultDebugProfileRate default sample/data fraction for profile sample collection rates (1/x, where x is the // data fraction sample rate). DefaultDebugProfileRate = 100 // DefaultDebugProfileDumpBufferSizeB default size of the pprof output buffer. DefaultDebugProfileDumpBufferSizeB = 1 << 17 )
const ( // KopiaDebugFlagForceGc force garbage collection before dumping heap data. KopiaDebugFlagForceGc = "forcegc" // KopiaDebugFlagDebug value of the profiles `debug` parameter. KopiaDebugFlagDebug = "debug" // KopiaDebugFlagRate rate setting for the named profile (if available). always an integer. KopiaDebugFlagRate = "rate" )
flags used to configure profiling in EnvVarKopiaDebugPprof.
const ( // ProfileNameBlock block profile key. ProfileNameBlock ProfileName = "block" // ProfileNameMutex mutex profile key. ProfileNameMutex = "mutex" // ProfileNameCPU cpu profile key. ProfileNameCPU = "cpu" )
const (
// EnvVarKopiaDebugPprof environment variable that contains the pprof dump configuration.
EnvVarKopiaDebugPprof = "KOPIA_PPROF_LOGGING_CONFIG"
)
const ( // PPROFDumpTimeout when dumping PPROF data, set an upper bound on the time it can take to log. PPROFDumpTimeout = 15 * time.Second )
Variables ¶
var ( // ErrEmptyProfileName returned when a profile configuration flag has no argument. ErrEmptyProfileName = errors.New("empty profile flag") )
Functions ¶
func LoadProfileConfig ¶
func LoadProfileConfig(ctx context.Context, ppconfigss string) (map[ProfileName]*ProfileConfig, error)
LoadProfileConfig configure PPROF profiling from the config in ppconfigss.
func StartProfileBuffers ¶
StartProfileBuffers start profile buffers for enabled profiles/trace. Buffers are returned in an slice of buffers: CPU, Heap and trace respectively. class is used to distinguish profiles external to kopia.
func StopProfileBuffers ¶
StopProfileBuffers stop and dump the contents of the buffers to the log as PEMs. Buffers supplied here are from StartProfileBuffers.
Types ¶
type ProfileConfig ¶
type ProfileConfig struct {
// contains filtered or unexported fields
}
ProfileConfig configuration flags for a profile.
type ProfileConfigs ¶
type ProfileConfigs struct {
// contains filtered or unexported fields
}
ProfileConfigs configuration flags for all requested profiles.
type ProfileName ¶
type ProfileName string
ProfileName the name of the profile (see: runtime/pprof/Lookup).