Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateUUID() string
- func GetLocalPID() string
- func NoopSendProfiles(interface{}) error
- type AllocationSampler
- type BlockSampler
- type CPUSampler
- type CallSite
- type Flag
- type Profile
- type Recorder
- type Sampler
- type SamplerConfig
- type SamplerScheduler
- type SendProfilesFunc
- type Timer
Constants ¶
View Source
const ( RuntimeGolang = "golang" CategoryCPU = "cpu" CategoryMemory = "memory" CategoryTime = "time" TypeCPUUsage = "cpu-usage" TypeMemoryAllocation = "memory-allocations" TypeBlockingCalls = "blocking-calls" UnitSample = "sample" UnitMillisecond = "millisecond" UnitMicrosecond = "microsecond" UnitNanosecond = "nanosecond" UnitByte = "byte" UnitKilobyte = "kilobyte" UnitPercent = "percent" )
View Source
const (
DefaultMaxBufferedProfiles = 100
)
Variables ¶
View Source
var (
GetPID = GetLocalPID
)
View Source
var (
IncludeProfilerFrames = false
)
Functions ¶
func GenerateUUID ¶
func GenerateUUID() string
func GetLocalPID ¶
func GetLocalPID() string
func NoopSendProfiles ¶
func NoopSendProfiles(interface{}) error
NoopSendProfiles is the default function to be called by Recorded to send collected profiles
Types ¶
type AllocationSampler ¶
type AllocationSampler struct{}
func NewAllocationSampler ¶
func NewAllocationSampler() *AllocationSampler
func (*AllocationSampler) Profile ¶
func (as *AllocationSampler) Profile(duration int64, timespan int64) (*Profile, error)
func (*AllocationSampler) Reset ¶
func (as *AllocationSampler) Reset()
func (*AllocationSampler) Start ¶
func (as *AllocationSampler) Start() error
func (*AllocationSampler) Stop ¶
func (as *AllocationSampler) Stop() error
type BlockSampler ¶
type BlockSampler struct {
// contains filtered or unexported fields
}
func NewBlockSampler ¶
func NewBlockSampler() *BlockSampler
func (*BlockSampler) Profile ¶
func (bs *BlockSampler) Profile(duration, timespan int64) (*Profile, error)
func (*BlockSampler) Reset ¶
func (bs *BlockSampler) Reset()
func (*BlockSampler) Start ¶
func (bs *BlockSampler) Start() error
func (*BlockSampler) Stop ¶
func (bs *BlockSampler) Stop() error
type CPUSampler ¶
type CPUSampler struct {
// contains filtered or unexported fields
}
func NewCPUSampler ¶
func NewCPUSampler() *CPUSampler
func (*CPUSampler) Profile ¶
func (cs *CPUSampler) Profile(duration int64, timespan int64) (*Profile, error)
func (*CPUSampler) Reset ¶
func (cs *CPUSampler) Reset()
func (*CPUSampler) Start ¶
func (cs *CPUSampler) Start() error
func (*CPUSampler) Stop ¶
func (cs *CPUSampler) Stop() error
type CallSite ¶
type CallSite struct { MethodName string FileName string FileLine int64 Metadata map[string]string // contains filtered or unexported fields }
func (*CallSite) FindOrAddChild ¶
func (*CallSite) Measurement ¶
type Flag ¶
type Flag struct {
// contains filtered or unexported fields
}
func (*Flag) SetIfUnset ¶
func (*Flag) UnsetIfSet ¶
type Profile ¶
type Profile struct { ID string ProcessID string Runtime string Category string Type string Unit string Roots []*CallSite Duration int64 Timespan int64 Timestamp int64 }
func NewProfile ¶
type Recorder ¶
type Recorder struct { FlushInterval int64 MaxBufferedProfiles int SendProfiles SendProfilesFunc // contains filtered or unexported fields }
func NewRecorder ¶
func NewRecorder() *Recorder
type SamplerConfig ¶
type SamplerScheduler ¶
type SamplerScheduler struct {
// contains filtered or unexported fields
}
func NewSamplerScheduler ¶
func NewSamplerScheduler(profileRecorder *Recorder, samp Sampler, config SamplerConfig) *SamplerScheduler
func (*SamplerScheduler) Report ¶
func (ss *SamplerScheduler) Report()
func (*SamplerScheduler) Reset ¶
func (ss *SamplerScheduler) Reset()
func (*SamplerScheduler) Start ¶
func (ss *SamplerScheduler) Start()
func (*SamplerScheduler) Stop ¶
func (ss *SamplerScheduler) Stop()
type SendProfilesFunc ¶
type SendProfilesFunc func(interface{}) error
SendProfilesFunc is a callback to emit collected profiles from recorder
Source Files ¶
Click to show internal directories.
Click to hide internal directories.