core

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BpfReader

type BpfReader struct {
	PerfReader    *perf.Reader
	RingBufReader *ringbuf.Reader
}

type BpfSpyer

type BpfSpyer interface {
	Start() error
	Stop() error
	ConsumeEvent() error
	Name() string
}

type ContainerInfo

type ContainerInfo struct {
	ContainerId string
	NameSpace   string
}

type ReaderType

type ReaderType int
const (
	PerfReader ReaderType = iota
	RingBufReader
)

type Session

type Session struct {
	Config     *SessionConfig
	DataBuffer chan *model.SpyEvent
	Sig        chan os.Signal
	// contains filtered or unexported fields
}

func NewSession

func NewSession(name string, config *SessionConfig, buf chan *model.SpyEvent) *Session

func (*Session) ConsumeEvent

func (s *Session) ConsumeEvent() error

func (*Session) Name

func (s *Session) Name() string

func (*Session) Start

func (s *Session) Start() error

func (*Session) Stop

func (s *Session) Stop() error

type SessionConfig

type SessionConfig struct {
	Container  ContainerInfo
	Pid        uint32
	StackInfo  bool
	Threshold  uint32
	SampleRate uint32
	Cpu        uint32
	RunTime    uint32 // hour unit
	BufferSize uint32
}

type SessionReader

type SessionReader struct {
	ReaderType ReaderType
	Limiter    *rate.Limiter
	BpfReader  BpfReader
	BufSize    int
	Data       any
	DataChan   chan any
}

func NewSessionReader

func NewSessionReader(bufSize int, perfReader *perf.Reader, ringBuf *ringbuf.Reader) *SessionReader

func (*SessionReader) DataRead

func (reader *SessionReader) DataRead() (any, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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