Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ProfileURLTemplate constant template for expected profiling endpoint URL. ProfileURLTemplate = "https://intake.profile.%s/v1/input" // ProfilingLocalURLTemplate is the constant used to compute the URL of the local trace agent ProfilingLocalURLTemplate = "http://%v/profiling/v1/input" // DefaultProfilingPeriod defines the default profiling period DefaultProfilingPeriod = 5 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func GetBlockProfileRate ¶
func GetBlockProfileRate() int
GetBlockProfileRate returns the current rate of goroutine blocking profile.
func GetMutexProfileFraction ¶
func GetMutexProfileFraction() int
GetMutexProfileFraction returns the current fraction of mutexes that generate profile data.
func IsRunning ¶
func IsRunning() bool
IsRunning returns true if the profiler is running; this function is thread-safe.
func SetBlockProfileRate ¶
func SetBlockProfileRate(rate int)
SetBlockProfileRate sets goroutine blocking profile rate.
func SetMutexProfileFraction ¶
func SetMutexProfileFraction(fraction int)
SetMutexProfileFraction sets fraction of mutexes that generate profiling data.
Types ¶
type Settings ¶
type Settings struct { // Site specifies the datadog site (datadoghq.com, datadoghq.eu, etc.) which profiles will be sent to. Site string // Env specifies the environment to which profiles should be registered. Env string // Service specifies the service name to attach to a profile. Service string // Period specifies the interval at which to collect profiles. Period time.Duration // CPUDuration specifies the length at which to collect CPU profiles. CPUDuration time.Duration // MutexProfileFraction, if set, turns on mutex profiles with rate // indicating the fraction of mutex contention events reported in the mutex // profile. MutexProfileFraction int // BlockProfileRate turns on block profiles with the given rate. BlockProfileRate int // WithGoroutineProfile additionally reports stack traces of all current goroutines WithGoroutineProfile bool // Tags are the additional tags to attach to profiles. Tags []string }
Settings contains the settings for internal profiling, to be passed to Start().
Click to show internal directories.
Click to hide internal directories.