Documentation ¶
Index ¶
- Constants
- func NewCpuAnalyzer(cfg interface{}, telemetry *component.TelemetryTools, ...) analyzer.Analyzer
- func ReceiveDataGroupAsSignal(data *model.DataGroup)
- type ApmSpanEvent
- type CPUType
- type CircleQueue
- type Config
- type CpuAnalyzer
- func (ca *CpuAnalyzer) ConsumableEvents() []string
- func (ca *CpuAnalyzer) ConsumeCpuEvent(event *model.KindlingEvent)
- func (ca *CpuAnalyzer) ConsumeEvent(event *model.KindlingEvent) error
- func (ca *CpuAnalyzer) ConsumeJavaFutexEvent(event *model.KindlingEvent)
- func (ca *CpuAnalyzer) ConsumeSpanEvent(event *model.KindlingEvent)
- func (ca *CpuAnalyzer) ConsumeTraces(trace *model.DataGroup)
- func (ca *CpuAnalyzer) ConsumeTransactionIdEvent(event *model.KindlingEvent)
- func (ca *CpuAnalyzer) JavaTraceDelete(interval time.Duration, expiredDuration time.Duration)
- func (ca *CpuAnalyzer) ProfileModule() (submodule string, start func() error, stop func() error)
- func (ca *CpuAnalyzer) PutEventToSegments(pid uint32, tid uint32, threadName string, event TimedEvent)
- func (ca *CpuAnalyzer) ReadTraceChan()
- func (ca *CpuAnalyzer) ReadTriggerEventChan()
- func (ca *CpuAnalyzer) Shutdown() error
- func (ca *CpuAnalyzer) Start() error
- func (ca *CpuAnalyzer) StartProfile() error
- func (ca *CpuAnalyzer) StopProfile() error
- func (ca *CpuAnalyzer) TidDelete(interval time.Duration, expiredDuration time.Duration)
- func (ca *CpuAnalyzer) Type() analyzer.Type
- type CpuEvent
- type InnerCall
- type JavaFutexEvent
- type ScheduledTask
- type ScheduledTaskRoutine
- type Segment
- type SendEventsTask
- type SendTriggerEvent
- type TimeSegments
- type TimedEvent
- type TimedEventKind
- type TransactionIdEvent
Constants ¶
View Source
const ( CpuEventLabel = "cpuEvents" JavaFutexEventLabel = "javaFutexEvents" TransactionIdEventLabel = "transactionIds" SpanLabel = "spans" InnerCallLabel = "innerCalls" )
View Source
const (
CpuProfile analyzer.Type = "cpuanalyzer"
)
Variables ¶
This section is empty.
Functions ¶
func NewCpuAnalyzer ¶
func ReceiveDataGroupAsSignal ¶
ReceiveDataGroupAsSignal receives model.DataGroup as a signal. Signal is used to trigger to send CPU on/off events
Types ¶
type ApmSpanEvent ¶
type ApmSpanEvent struct { StartTime uint64 `json:"startTime"` EndTime uint64 `json:"endTime"` TraceId string `json:"traceId"` Name string `json:"name"` }
func (*ApmSpanEvent) EndTimestamp ¶
func (j *ApmSpanEvent) EndTimestamp() uint64
func (*ApmSpanEvent) Kind ¶
func (j *ApmSpanEvent) Kind() TimedEventKind
func (*ApmSpanEvent) StartTimestamp ¶
func (j *ApmSpanEvent) StartTimestamp() uint64
type CircleQueue ¶
type CircleQueue struct {
// contains filtered or unexported fields
}
func NewCircleQueue ¶
func NewCircleQueue(length int) *CircleQueue
func (*CircleQueue) Clear ¶
func (s *CircleQueue) Clear()
func (*CircleQueue) GetByIndex ¶
func (s *CircleQueue) GetByIndex(index int) interface{}
func (*CircleQueue) UpdateByIndex ¶
func (s *CircleQueue) UpdateByIndex(index int, val interface{})
type Config ¶
type Config struct { // SamplingInterval is the sampling interval for the same url. // The unit is seconds. SamplingInterval int `mapstructure:"sampling_interval"` // OpenJavaTraceSampling a switch for whether to use Java-Trace to trigger sampling. // The default is false. OpenJavaTraceSampling bool `mapstructure:"open_java_trace_sampling"` //JavaTraceSlowTime is used to identify the threshold of slow requests recognized by the apm side // The unit is seconds. JavaTraceSlowTime int `mapstructure:"java_trace_slow_time"` // SegmentSize defines how many segments(seconds) can be cached to wait for sending. // The elder segments will be overwritten by the newer ones, so don't set it too low. SegmentSize int `mapstructure:"segment_size"` // EdgeEventsWindowSize is the size of the duration window that seats the edge events. // The unit is seconds. The greater it is, the more data will be stored. EdgeEventsWindowSize int `mapstructure:"edge_events_window_size"` // JavaTraceDeleteInterval is the interval for cleaning up expired data in javatraces. // The unit is seconds. JavaTraceDeleteInterval int `mapstructure:"java_trace_delete_interval"` // JavaTraceExpirationTime is the expiration time for data in javatraces. // The unit is seconds. JavaTraceExpirationTime int `mapstructure:"java_trace_expiration_time"` }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
type CpuAnalyzer ¶
type CpuAnalyzer struct {
// contains filtered or unexported fields
}
func (*CpuAnalyzer) ConsumableEvents ¶
func (ca *CpuAnalyzer) ConsumableEvents() []string
func (*CpuAnalyzer) ConsumeCpuEvent ¶
func (ca *CpuAnalyzer) ConsumeCpuEvent(event *model.KindlingEvent)
func (*CpuAnalyzer) ConsumeEvent ¶
func (ca *CpuAnalyzer) ConsumeEvent(event *model.KindlingEvent) error
func (*CpuAnalyzer) ConsumeJavaFutexEvent ¶
func (ca *CpuAnalyzer) ConsumeJavaFutexEvent(event *model.KindlingEvent)
func (*CpuAnalyzer) ConsumeSpanEvent ¶
func (ca *CpuAnalyzer) ConsumeSpanEvent(event *model.KindlingEvent)
func (*CpuAnalyzer) ConsumeTraces ¶
func (ca *CpuAnalyzer) ConsumeTraces(trace *model.DataGroup)
func (*CpuAnalyzer) ConsumeTransactionIdEvent ¶
func (ca *CpuAnalyzer) ConsumeTransactionIdEvent(event *model.KindlingEvent)
func (*CpuAnalyzer) JavaTraceDelete ¶
func (ca *CpuAnalyzer) JavaTraceDelete(interval time.Duration, expiredDuration time.Duration)
func (*CpuAnalyzer) ProfileModule ¶
func (ca *CpuAnalyzer) ProfileModule() (submodule string, start func() error, stop func() error)
func (*CpuAnalyzer) PutEventToSegments ¶
func (ca *CpuAnalyzer) PutEventToSegments(pid uint32, tid uint32, threadName string, event TimedEvent)
func (*CpuAnalyzer) ReadTraceChan ¶
func (ca *CpuAnalyzer) ReadTraceChan()
ReadTraceChan reads the trace channel and make cpuanalyzer consume them as general events.
func (*CpuAnalyzer) ReadTriggerEventChan ¶
func (ca *CpuAnalyzer) ReadTriggerEventChan()
ReadTriggerEventChan reads the triggerEvent channel and creates tasks to send cpuEvents.
func (*CpuAnalyzer) Shutdown ¶
func (ca *CpuAnalyzer) Shutdown() error
func (*CpuAnalyzer) Start ¶
func (ca *CpuAnalyzer) Start() error
func (*CpuAnalyzer) StartProfile ¶
func (ca *CpuAnalyzer) StartProfile() error
func (*CpuAnalyzer) StopProfile ¶
func (ca *CpuAnalyzer) StopProfile() error
func (*CpuAnalyzer) TidDelete ¶
func (ca *CpuAnalyzer) TidDelete(interval time.Duration, expiredDuration time.Duration)
func (*CpuAnalyzer) Type ¶
func (ca *CpuAnalyzer) Type() analyzer.Type
type CpuEvent ¶
type CpuEvent struct { StartTime uint64 `json:"startTime"` EndTime uint64 `json:"endTime"` TypeSpecs []uint64 `json:"typeSpecs"` RunqLatency []uint64 `json:"runqLatency"` TimeType []CPUType `json:"timeType"` OnInfo string `json:"onInfo"` OffInfo string `json:"offInfo"` Log string `json:"log"` Stack string `json:"stack"` }
func (*CpuEvent) EndTimestamp ¶
func (*CpuEvent) Kind ¶
func (c *CpuEvent) Kind() TimedEventKind
func (*CpuEvent) StartTimestamp ¶
type InnerCall ¶
type InnerCall struct { StartTime uint64 `json:"startTime"` EndTime uint64 `json:"endTime"` Trace *model.DataGroup `json:"trace"` }
func (*InnerCall) EndTimestamp ¶
func (*InnerCall) Kind ¶
func (c *InnerCall) Kind() TimedEventKind
func (*InnerCall) StartTimestamp ¶
type JavaFutexEvent ¶
type JavaFutexEvent struct { StartTime uint64 `json:"startTime"` EndTime uint64 `json:"endTime"` DataVal string `json:"dataValue"` }
func (*JavaFutexEvent) EndTimestamp ¶
func (j *JavaFutexEvent) EndTimestamp() uint64
func (*JavaFutexEvent) Kind ¶
func (j *JavaFutexEvent) Kind() TimedEventKind
func (*JavaFutexEvent) StartTimestamp ¶
func (j *JavaFutexEvent) StartTimestamp() uint64
type ScheduledTask ¶
type ScheduledTask interface {
// contains filtered or unexported methods
}
type ScheduledTaskRoutine ¶
type ScheduledTaskRoutine struct {
// contains filtered or unexported fields
}
func NewAndStartScheduledTaskRoutine ¶
func NewAndStartScheduledTaskRoutine( tickerDuration time.Duration, expiredDuration time.Duration, task ScheduledTask, expiredCallback func()) *ScheduledTaskRoutine
NewAndStartScheduledTaskRoutine creates a new routine and start it immediately.
func (*ScheduledTaskRoutine) Start ¶
func (s *ScheduledTaskRoutine) Start() error
func (*ScheduledTaskRoutine) Stop ¶
func (s *ScheduledTaskRoutine) Stop() error
type Segment ¶
type Segment struct { StartTime uint64 `json:"startTime"` EndTime uint64 `json:"endTime"` CpuEvents []TimedEvent `json:"cpuEvents"` JavaFutexEvents []TimedEvent `json:"javaFutexEvents"` TransactionIds []TimedEvent `json:"transactionIds"` Spans []TimedEvent `json:"spans"` InnerCalls []TimedEvent `json:"innerCalls"` IsSend int IndexTimestamp string `json:"indexTimestamp"` }
func (*Segment) UnmarshalJSON ¶
type SendEventsTask ¶
type SendEventsTask struct {
// contains filtered or unexported fields
}
type SendTriggerEvent ¶
type TimeSegments ¶
type TimeSegments struct { Pid uint32 `json:"pid"` Tid uint32 `json:"tid"` ThreadName string `json:"threadName"` BaseTime uint64 `json:"baseTime"` Segments *CircleQueue `json:"segments"` }
type TimedEvent ¶
type TimedEvent interface { StartTimestamp() uint64 EndTimestamp() uint64 Kind() TimedEventKind }
type TimedEventKind ¶
type TimedEventKind int
const ( TimedCpuEventKind TimedEventKind = iota TimedJavaFutexEventKind TimedTransactionIdEventKind TimedApmSpanEventKind TimedInnerCallEventKind )
type TransactionIdEvent ¶
type TransactionIdEvent struct { Timestamp uint64 `json:"timestamp"` TraceId string `json:"traceId"` IsEntry uint32 `json:"isEntry"` Protocol string `json:"protocol"` Url string `json:"url"` PidString string `json:"pidString"` ContainerId string `json:"containerId"` }
func (*TransactionIdEvent) EndTimestamp ¶
func (t *TransactionIdEvent) EndTimestamp() uint64
func (*TransactionIdEvent) Kind ¶
func (t *TransactionIdEvent) Kind() TimedEventKind
func (*TransactionIdEvent) StartTimestamp ¶
func (t *TransactionIdEvent) StartTimestamp() uint64
Click to show internal directories.
Click to hide internal directories.