Documentation ¶
Index ¶
- Variables
- type BlockProfileCollector
- func (p *BlockProfileCollector) Collect(durationSeconds int64, isSnapshot, useCache bool, ...) (*common.ProfileData, error)
- func (p *BlockProfileCollector) FileName() string
- func (p *BlockProfileCollector) GetPrevious() *profile.Profile
- func (p *BlockProfileCollector) Name() string
- func (p *BlockProfileCollector) SetPrevious(pre *profile.Profile)
- func (p *BlockProfileCollector) SupportDelta() bool
- type CPUProfileCollector
- func (p *CPUProfileCollector) Collect(durationSeconds int64, _, _ bool, _ []common.SampleType) (*common.ProfileData, error)
- func (p *CPUProfileCollector) FileName() string
- func (p *CPUProfileCollector) GetPrevious() *profile.Profile
- func (p *CPUProfileCollector) Name() string
- func (p *CPUProfileCollector) SetPrevious(*profile.Profile)
- func (p *CPUProfileCollector) SupportDelta() bool
- type Config
- type GoroutineProfileCollector
- func (p *GoroutineProfileCollector) Collect(durationSeconds int64, isSnapshot, useCache bool, ...) (*common.ProfileData, error)
- func (p *GoroutineProfileCollector) FileName() string
- func (p *GoroutineProfileCollector) GetPrevious() *profile.Profile
- func (p *GoroutineProfileCollector) Name() string
- func (p *GoroutineProfileCollector) SetPrevious(pre *profile.Profile)
- func (p *GoroutineProfileCollector) SupportDelta() bool
- type HeapProfileCollector
- func (p *HeapProfileCollector) Collect(durationSeconds int64, isSnapshot, useCache bool, ...) (*common.ProfileData, error)
- func (p *HeapProfileCollector) FileName() string
- func (p *HeapProfileCollector) GetPrevious() *profile.Profile
- func (p *HeapProfileCollector) Name() string
- func (p *HeapProfileCollector) SetPrevious(pre *profile.Profile)
- func (p *HeapProfileCollector) SupportDelta() bool
- type MutexProfileCollector
- func (p *MutexProfileCollector) Collect(durationSeconds int64, isSnapshot, useCache bool, ...) (*common.ProfileData, error)
- func (p *MutexProfileCollector) FileName() string
- func (p *MutexProfileCollector) GetPrevious() *profile.Profile
- func (p *MutexProfileCollector) Name() string
- func (p *MutexProfileCollector) SetPrevious(pre *profile.Profile)
- func (p *MutexProfileCollector) SupportDelta() bool
- type Option
- func WithBackoffInterval(internal time.Duration) Option
- func WithBlockProfile(rate int) Option
- func WithBlockProfileDefault() Option
- func WithHTTPEndPoint(schema, host string, timeout time.Duration) Option
- func WithLogger(l logger.Logger) Option
- func WithMutexProfile(fraction int) Option
- func WithMutexProfileDefault() Option
- func WithRetryCount(count int) Option
- type ProfileCollector
- type Profiler
Constants ¶
This section is empty.
Variables ¶
var ErrorUnknownProfile = errors.New("unknown profile")
Functions ¶
This section is empty.
Types ¶
type BlockProfileCollector ¶
type BlockProfileCollector struct {
// contains filtered or unexported fields
}
func (*BlockProfileCollector) Collect ¶
func (p *BlockProfileCollector) Collect(durationSeconds int64, isSnapshot, useCache bool, targetDeltaSampleTypes []common.SampleType) (*common.ProfileData, error)
func (*BlockProfileCollector) FileName ¶
func (p *BlockProfileCollector) FileName() string
func (*BlockProfileCollector) GetPrevious ¶
func (p *BlockProfileCollector) GetPrevious() *profile.Profile
func (*BlockProfileCollector) Name ¶
func (p *BlockProfileCollector) Name() string
func (*BlockProfileCollector) SetPrevious ¶
func (p *BlockProfileCollector) SetPrevious(pre *profile.Profile)
func (*BlockProfileCollector) SupportDelta ¶
func (p *BlockProfileCollector) SupportDelta() bool
type CPUProfileCollector ¶
type CPUProfileCollector struct{}
func (*CPUProfileCollector) Collect ¶
func (p *CPUProfileCollector) Collect(durationSeconds int64, _, _ bool, _ []common.SampleType) (*common.ProfileData, error)
func (*CPUProfileCollector) FileName ¶
func (p *CPUProfileCollector) FileName() string
func (*CPUProfileCollector) GetPrevious ¶
func (p *CPUProfileCollector) GetPrevious() *profile.Profile
func (*CPUProfileCollector) Name ¶
func (p *CPUProfileCollector) Name() string
func (*CPUProfileCollector) SetPrevious ¶
func (p *CPUProfileCollector) SetPrevious(*profile.Profile)
func (*CPUProfileCollector) SupportDelta ¶
func (p *CPUProfileCollector) SupportDelta() bool
type GoroutineProfileCollector ¶
type GoroutineProfileCollector struct {
// contains filtered or unexported fields
}
func (*GoroutineProfileCollector) Collect ¶
func (p *GoroutineProfileCollector) Collect(durationSeconds int64, isSnapshot, useCache bool, targetDeltaSampleTypes []common.SampleType) (*common.ProfileData, error)
func (*GoroutineProfileCollector) FileName ¶
func (p *GoroutineProfileCollector) FileName() string
func (*GoroutineProfileCollector) GetPrevious ¶
func (p *GoroutineProfileCollector) GetPrevious() *profile.Profile
func (*GoroutineProfileCollector) Name ¶
func (p *GoroutineProfileCollector) Name() string
func (*GoroutineProfileCollector) SetPrevious ¶
func (p *GoroutineProfileCollector) SetPrevious(pre *profile.Profile)
func (*GoroutineProfileCollector) SupportDelta ¶
func (p *GoroutineProfileCollector) SupportDelta() bool
type HeapProfileCollector ¶
type HeapProfileCollector struct {
// contains filtered or unexported fields
}
func (*HeapProfileCollector) Collect ¶
func (p *HeapProfileCollector) Collect(durationSeconds int64, isSnapshot, useCache bool, targetDeltaSampleTypes []common.SampleType) (*common.ProfileData, error)
func (*HeapProfileCollector) FileName ¶
func (p *HeapProfileCollector) FileName() string
func (*HeapProfileCollector) GetPrevious ¶
func (p *HeapProfileCollector) GetPrevious() *profile.Profile
func (*HeapProfileCollector) Name ¶
func (p *HeapProfileCollector) Name() string
func (*HeapProfileCollector) SetPrevious ¶
func (p *HeapProfileCollector) SetPrevious(pre *profile.Profile)
func (*HeapProfileCollector) SupportDelta ¶
func (p *HeapProfileCollector) SupportDelta() bool
type MutexProfileCollector ¶
type MutexProfileCollector struct {
// contains filtered or unexported fields
}
func (*MutexProfileCollector) Collect ¶
func (p *MutexProfileCollector) Collect(durationSeconds int64, isSnapshot, useCache bool, targetDeltaSampleTypes []common.SampleType) (*common.ProfileData, error)
func (*MutexProfileCollector) FileName ¶
func (p *MutexProfileCollector) FileName() string
func (*MutexProfileCollector) GetPrevious ¶
func (p *MutexProfileCollector) GetPrevious() *profile.Profile
func (*MutexProfileCollector) Name ¶
func (p *MutexProfileCollector) Name() string
func (*MutexProfileCollector) SetPrevious ¶
func (p *MutexProfileCollector) SetPrevious(pre *profile.Profile)
func (*MutexProfileCollector) SupportDelta ¶
func (p *MutexProfileCollector) SupportDelta() bool
type Option ¶
type Option func(*Config)
func WithBackoffInterval ¶
WithBackoffInterval set wait interval between retries when data upload fail
func WithBlockProfile ¶
WithBlockProfile enables blockProfile with rate, rate's unit is nanoseconds, which means 1 blocking event per rate nanoseconds is reported. see runtime.SetBlockProfileRate BlockProfile is disabled by default. In most cases, BlockProfile has low CPU overhead. However, please be aware that BlockProfile can cause CPU overhead under certain circumstance. (Setting rate to 10,000ns may cause up to 4% CPU overhead in some scenario according to document https://github.com/DataDog/go-profiler-notes/blob/main/guide/README.md#block-profiler-limitations). For safety defaultBlockRate is set to 100,000,000ns(100ms), meaning block events with duration longer than 100ms will be recorded, while block events with duration of 1ms has a 1% chance to be recorded.
func WithBlockProfileDefault ¶ added in v1.3.6
func WithBlockProfileDefault() Option
func WithHTTPEndPoint ¶
WithHTTPEndPoint set http endpoint for both settings and profile data thus bypass server-agent, which is useful where server-agent is not installed
func WithMutexProfile ¶
WithMutexProfile enables mutexProfile with fraction, which means on average 1/fraction events are reported. see runtime.SetMutexProfileFraction MutexProfile is disabled by default. When using modest fraction (e.g. 100) MutexProfile has little impact on performance.
func WithMutexProfileDefault ¶ added in v1.3.6
func WithMutexProfileDefault() Option
func WithRetryCount ¶
WithRetryCount set retry count when data upload fail
type ProfileCollector ¶
type ProfileCollector interface { Name() string FileName() string SupportDelta() bool //see go/src/net/http/pprof.go -> profileSupportsDelta GetPrevious() *profile.Profile SetPrevious(*profile.Profile) Collect(durationSeconds int64, isSnapshot, useCache bool, targetDeltaSampleTypes []common.SampleType) (*common.ProfileData, error) }
func GetProfileCollector ¶
func GetProfileCollector(pt common.ProfileType) ProfileCollector
type Profiler ¶
type Profiler struct {
// contains filtered or unexported fields
}
func NewProfiler ¶
NewProfiler fetch profileTasks from remoteConfig then profile and send pprof data to backend
func (*Profiler) DebugTasks ¶
DebugTasks create a debug task. DEBUG ONLY.