base

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const MissingSymbol = "[MISSING]"

Variables

This section is empty.

Functions

This section is empty.

Types

type ExtensionConfig added in v0.4.0

type ExtensionConfig struct {
	NetworkSamplings []*NetworkSamplingRule `json:"NetworkSamplings"`
}

type HTTPSamplingConfig added in v0.4.0

type HTTPSamplingConfig struct {
	DefaultRequestEncoding  string `mapstructure:"default_request_encoding"`  // default http request body encoding
	DefaultResponseEncoding string `mapstructure:"default_response_encoding"` // default http response body encoding
}

type NetworkConfig added in v0.4.0

type NetworkConfig struct {
	ReportInterval  string                `mapstructure:"report_interval"`  // The duration of data report interval
	MeterPrefix     string                `mapstructure:"meter_prefix"`     // The prefix of meter name
	ProtocolAnalyze ProtocolAnalyzeConfig `mapstructure:"protocol_analyze"` // The 7-Layer protocol analyze
}

type NetworkDataCollectingSettings added in v0.4.0

type NetworkDataCollectingSettings struct {
	RequireCompleteRequest  bool  `json:"RequireCompleteRequest"`
	MaxRequestSize          int32 `json:"MaxRequestSize"`
	RequireCompleteResponse bool  `json:"RequireCompleteResponse"`
	MaxResponseSize         int32 `json:"MaxResponseSize"`
}

type NetworkSamplingRule added in v0.4.0

type NetworkSamplingRule struct {
	URIRegex    *string                        `json:"URIRegex"`
	MinDuration *int32                         `json:"MinDuration"`
	When4XX     bool                           `json:"When4xx"`
	When5XX     bool                           `json:"When5xx"`
	Settings    *NetworkDataCollectingSettings `json:"Settings"`
}

type OnCPUConfig

type OnCPUConfig struct {
	Period string `mapstructure:"dump_period"` // The duration of dump stack
}

type ProfileTaskRunner

type ProfileTaskRunner interface {
	// Init runner with profiling task and process
	Init(task *ProfilingTask, processes []api.ProcessInterface) error
	// Run profiling, if throw error or method finish means the profiling task finished
	Run(ctx context.Context, notify ProfilingRunningSuccessNotify) error
	// Stop the runner initiative, is typically used to specify the profiling duration
	Stop() error
	// FlushData means dump the exists profiling data and flush them to the backend protocol format
	FlushData() ([]*v3.EBPFProfilingData, error)
}

ProfileTaskRunner is use to running different type of profiling task, such as on-cpu profiling task

type ProfilingRunningSuccessNotify

type ProfilingRunningSuccessNotify func()

type ProfilingTask

type ProfilingTask struct {
	// TaskID of profiling task
	TaskID string
	// ProcessIDList of need to monitoring process
	ProcessIDList []string
	// UpdateTime of profiling task
	UpdateTime int64
	// StartTime of profiling task, when need to start to profiling
	StartTime int64
	// TriggerType of task
	TriggerType TriggerType
	// TargetType of task
	TargetType TargetType
	// MaxRunningDuration of task
	MaxRunningDuration time.Duration
	ExtensionConfig    *ExtensionConfig
}

func ProfilingTaskFromCommand

func ProfilingTaskFromCommand(command *v3.Command) (*ProfilingTask, error)

func ProfilingTaskFromContinuous added in v0.5.0

func ProfilingTaskFromContinuous(processes []api.ProcessInterface, taskSetter func(task *ProfilingTask)) *ProfilingTask

type ProtocolAnalyzeConfig added in v0.4.0

type ProtocolAnalyzeConfig struct {
	PerCPUBufferSize string         `mapstructure:"per_cpu_buffer"`
	Parallels        int            `mapstructure:"parallels"`
	QueueSize        int            `mapstructure:"queue_size"`
	Sampling         SamplingConfig `mapstructure:"sampling"`
}

type Runner added in v0.2.0

type Runner struct {
	StackNotFoundCache map[uint32]bool
	ShutdownOnce       sync.Once
}

func NewBaseRunner added in v0.2.0

func NewBaseRunner() *Runner

func (*Runner) GenerateProfilingData added in v0.2.0

func (r *Runner) GenerateProfilingData(profilingInfo *profiling.Info, stackID uint32, stackMap *ebpf.Map,
	stackType v3.EBPFProfilingStackType, symbolArray []uint64) *v3.EBPFProfilingStackMetadata

type SamplingConfig added in v0.4.0

type SamplingConfig struct {
	HTTP HTTPSamplingConfig `mapstructure:"http"`
}

type TargetType

type TargetType string
const (
	TargetTypeOnCPU           TargetType = "ON_CPU"
	TargetTypeOffCPU          TargetType = "OFF_CPU"
	TargetTypeNetworkTopology TargetType = "NETWORK"
)

func ParseTargetType

func ParseTargetType(err error, val string) (TargetType, error)

func (TargetType) InitTask

func (t TargetType) InitTask(task *ProfilingTask, command *v3.Command) error

type TaskConfig

type TaskConfig struct {
	OnCPU   *OnCPUConfig   `mapstructure:"on_cpu"`  // ON_CPU type of profiling task config
	Network *NetworkConfig `mapstructure:"network"` // NETWORK type of profiling task config
}

func (*TaskConfig) Validate added in v0.4.0

func (c *TaskConfig) Validate() error

type TriggerType

type TriggerType string
const (
	TriggerTypeFixedTime TriggerType = "FIXED_TIME"
)

func ParseTriggerType

func ParseTriggerType(err error, val string) (TriggerType, error)

func (TriggerType) InitTask

func (t TriggerType) InitTask(task *ProfilingTask, command *v3.Command) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL