Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateUUID() string
- func NoopSendProfiles([]AgentProfile) error
- type AgentCallSite
- type AgentProfile
- 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 (
IncludeProfilerFrames = false
)
Functions ¶
func GenerateUUID ¶
func GenerateUUID() string
func NoopSendProfiles ¶
func NoopSendProfiles([]AgentProfile) error
NoopSendProfiles is the default function to be called by Recorded to send collected profiles
Types ¶
type AgentCallSite ¶ added in v1.13.2
type AgentCallSite struct { MethodName string `json:"method_name"` FileName string `json:"file_name"` FileLine int64 `json:"file_line"` Measurement float64 `json:"measurement"` NumSamples int64 `json:"num_samples"` Children []AgentCallSite `json:"children"` }
AgentCallSite is a presenter type used to serialize a call site to JSON format supported by Instana profile sensor
func NewAgentCallSite ¶ added in v1.13.2
func NewAgentCallSite(cs *CallSite) AgentCallSite
type AgentProfile ¶ added in v1.13.2
type AgentProfile struct { ID string `json:"id"` Runtime string `json:"runtime"` Category string `json:"category"` Type string `json:"type"` Unit string `json:"unit"` Roots []AgentCallSite `json:"roots"` Duration int64 `json:"duration"` Timespan int64 `json:"timespan"` Timestamp int64 `json:"timestamp"` }
AgentProfile is a presenter type used to serialize a collected profile to JSON format supported by Instana profile sensor
func NewAgentProfile ¶ added in v1.13.2
func NewAgentProfile(p *Profile) AgentProfile
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 Recorder ¶
type Recorder struct { FlushInterval int64 MaxBufferedProfiles int SendProfiles SendProfilesFunc // contains filtered or unexported fields }
func NewRecorder ¶
func NewRecorder() *Recorder
func (*Recorder) Record ¶
func (pr *Recorder) Record(record AgentProfile)
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([]AgentProfile) error
SendProfilesFunc is a callback to emit collected profiles from recorder
Source Files ¶
Click to show internal directories.
Click to hide internal directories.