internal

package
v0.0.0-...-51da36d Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const HostProc = "HOST_PROC_PATH"

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(connStats *ConnectionStats, connMap map[ConnKey]*ConnectionStats) *ConnectionStats

type ConnKey

type ConnKey struct {
	SrcIP   string
	SrcPort uint32
	DstIP   string
	DstPort uint32
}

func (*ConnKey) String

func (k *ConnKey) String() string

type ConnectMonitor

type ConnectMonitor struct {
	// contains filtered or unexported fields
}

ConnectMonitor reads in events related to TCP connect operations and updates its status to record the connection procedure. This is not thread safe to use.

func NewConnectMonitor

func NewConnectMonitor(logger *component.TelemetryLogger) *ConnectMonitor

func (*ConnectMonitor) GetMapSize

func (c *ConnectMonitor) GetMapSize() int

func (*ConnectMonitor) ReadInConnectExitSyscall

func (c *ConnectMonitor) ReadInConnectExitSyscall(event *model.KindlingEvent) (*ConnectionStats, error)

func (*ConnectMonitor) ReadInTcpConnect

func (c *ConnectMonitor) ReadInTcpConnect(event *model.KindlingEvent) (*ConnectionStats, error)

func (*ConnectMonitor) ReadInTcpSetState

func (c *ConnectMonitor) ReadInTcpSetState(event *model.KindlingEvent) (*ConnectionStats, error)

func (*ConnectMonitor) ReadSendRequestSyscall

func (c *ConnectMonitor) ReadSendRequestSyscall(event *model.KindlingEvent) (*ConnectionStats, error)

func (*ConnectMonitor) TrimConnectionsWithTcpStat

func (c *ConnectMonitor) TrimConnectionsWithTcpStat(waitForEventSecond int) []*ConnectionStats

type ConnectionStats

type ConnectionStats struct {
	Pid              uint32
	Comm             string
	ContainerId      string
	ConnKey          ConnKey
	StateMachine     *StateMachine
	InitialTimestamp uint64
	EndTimestamp     uint64
	Code             int
}

func (*ConnectionStats) GetConnectDuration

func (c *ConnectionStats) GetConnectDuration() int64

type EventType

type EventType string

type NetSocketStateMap

type NetSocketStateMap map[SocketKey]string

NetSocketStateMap represents the map between socket and its state.

func NewPidTcpStat

func NewPidTcpStat(hostProc string, pid int) (NetSocketStateMap, error)

type SocketKey

type SocketKey struct {
	LocalAddr string
	LocalPort uint64
	RemAddr   string
	RemPort   uint64
}

This contains generic data structures for both udp and tcp sockets.

type State

type State struct {
	// contains filtered or unexported fields
}

type StateMachine

type StateMachine struct {
	// contains filtered or unexported fields
}

func NewStateMachine

func NewStateMachine(initialState StateType, statesResource StatesResource, connStats *ConnectionStats) *StateMachine

func (*StateMachine) GetCurrentState

func (s *StateMachine) GetCurrentState() StateType

func (*StateMachine) GetLastState

func (s *StateMachine) GetLastState() StateType

func (*StateMachine) ReceiveEvent

func (s *StateMachine) ReceiveEvent(event EventType, connMap map[ConnKey]*ConnectionStats) (*ConnectionStats, error)

type StateType

type StateType string
const (
	Inprogress StateType = "inprogress"
	Success    StateType = "success"
	Failure    StateType = "failure"
	Closed     StateType = "closed"
)

type StatesResource

type StatesResource map[StateType]State

Jump to

Keyboard shortcuts

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