processtree

package
v1.35.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NoopProcessTreeCollector

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

func NewNoop

func NewNoop() *NoopProcessTreeCollector

func (*NoopProcessTreeCollector) Events

func (d *NoopProcessTreeCollector) Events() <-chan ProcessTreeEvent

func (*NoopProcessTreeCollector) ProcessExited

func (d *NoopProcessTreeCollector) ProcessExited(eventTime time.Time, containerID string, processKey ProcessKey, parent ProcessKey, exitTime uint64)

func (*NoopProcessTreeCollector) ProcessForked

func (d *NoopProcessTreeCollector) ProcessForked(eventTime time.Time, containerID string, parent ProcessKey, processKey ProcessKey)

func (*NoopProcessTreeCollector) ProcessStarted

func (d *NoopProcessTreeCollector) ProcessStarted(eventTime time.Time, containerID string, p Process)

type Process

type Process struct {
	PID             proc.PID
	StartTime       time.Duration
	PPID            proc.PID
	ParentStartTime time.Duration
	Args            []string
	FilePath        string
	ExitTime        uint64
}

func (Process) Exited

func (p Process) Exited() bool

type ProcessAction

type ProcessAction int
const (
	ProcessUnknown ProcessAction = iota
	ProcessExec
	ProcessFork
	ProcessExit
)

func (ProcessAction) String

func (a ProcessAction) String() string

type ProcessEvent

type ProcessEvent struct {
	Timestamp   time.Time
	ContainerID string
	Process     Process
	Action      ProcessAction
}

func (ProcessEvent) String added in v1.22.0

func (e ProcessEvent) String() string

type ProcessEventListener

type ProcessEventListener func(e ProcessEvent)

type ProcessKey

type ProcessKey struct {
	PID proc.PID
	// NOTE: StartTime will be stored in seconds since boot, since this is the best resolution we can get everywhere
	// we need. This should still be good enough to identify a process.
	StartTime time.Duration
}

func ToProcessKey

func ToProcessKey(pid proc.PID, startTime time.Duration) ProcessKey

func (ProcessKey) Empty

func (k ProcessKey) Empty() bool

func (ProcessKey) String

func (k ProcessKey) String() string

type ProcessTreeCollector

type ProcessTreeCollector interface {
	Events() <-chan ProcessTreeEvent
}

type ProcessTreeCollectorImpl

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

func New

func New(log *logging.Logger, p *proc.Proc, containersClient containerClient) (*ProcessTreeCollectorImpl, error)

func (*ProcessTreeCollectorImpl) Events

func (c *ProcessTreeCollectorImpl) Events() <-chan ProcessTreeEvent

func (*ProcessTreeCollectorImpl) Init

type ProcessTreeEvent

type ProcessTreeEvent struct {
	Initial bool
	Events  []ProcessEvent
}

Jump to

Keyboard shortcuts

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