processtree

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 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
}

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 ToProcessKeyNs

func ToProcessKeyNs(pid proc.PID, startTimeNs uint64) ProcessKey

func (ProcessKey) Empty

func (k ProcessKey) Empty() bool

func (ProcessKey) String

func (k ProcessKey) String() string

type ProcessTreeCollector

type ProcessTreeCollector interface {
	ProcessStarted(eventTime time.Time, containerID string, p Process)
	ProcessForked(eventTime time.Time, containerID string, parent ProcessKey, processKey ProcessKey)
	ProcessExited(eventTime time.Time, containerID string, processKey ProcessKey, parentProcessKey ProcessKey, exitTime uint64)
	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

func (*ProcessTreeCollectorImpl) ProcessExited

func (c *ProcessTreeCollectorImpl) ProcessExited(eventTime time.Time, containerID string, processKey ProcessKey, parentProcessKey ProcessKey, exitTime uint64)

func (*ProcessTreeCollectorImpl) ProcessForked

func (c *ProcessTreeCollectorImpl) ProcessForked(eventTime time.Time, containerID string, parent ProcessKey, processKey ProcessKey)

func (*ProcessTreeCollectorImpl) ProcessStarted

func (c *ProcessTreeCollectorImpl) ProcessStarted(eventTime time.Time, containerID string, p Process)

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