Help us shape the future of Go! Take the 2026 Go Developer Survey

processtree

package
v0.3.308 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetContainerSubtreeError added in v0.3.3

type GetContainerSubtreeError struct {
	Err error
}

func (*GetContainerSubtreeError) Error added in v0.3.3

func (e *GetContainerSubtreeError) Error() string

func (*GetContainerSubtreeError) Unwrap added in v0.3.3

func (e *GetContainerSubtreeError) Unwrap() error

type ProcessTreeManager

type ProcessTreeManager interface {
	Start()
	Stop()
	GetContainerProcessTree(containerID string, pid uint32, useCache bool) (armotypes.Process, error)
	ReportEvent(eventType utils.EventType, event utils.K8sEvent) error
	GetPidList() []uint32
	// GetProcessBootTimeNs returns the process's creation time as nanoseconds
	// since boot (CLOCK_BOOTTIME), sourced exclusively from /proc/<pid>/stat
	// field 22 — either the periodic scan or the on-demand read performed when a
	// fork/exec creates the node. Returns 0 when unknown: the process died
	// before its creation event was processed, or it has already exited.
	//
	// This is the sole process-identity time source. The wall-clock
	// armotypes.Process.StartTime carried on tree nodes is display-only and
	// inherits btime's whole-second skew, so it must never be compared for
	// identity.
	GetProcessBootTimeNs(pid uint32) uint64
}

func NewProcessTreeManager

NewProcessTreeManager creates a new process tree manager

type ProcessTreeManagerImpl

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

ProcessTreeManagerImpl implements the ProcessTreeManager interface

func (*ProcessTreeManagerImpl) GetContainerProcessTree

func (ptm *ProcessTreeManagerImpl) GetContainerProcessTree(containerID string, pid uint32, useCache bool) (armotypes.Process, error)

func (*ProcessTreeManagerImpl) GetPidList added in v0.2.384

func (ptm *ProcessTreeManagerImpl) GetPidList() []uint32

func (*ProcessTreeManagerImpl) GetProcessBootTimeNs added in v0.3.167

func (ptm *ProcessTreeManagerImpl) GetProcessBootTimeNs(pid uint32) uint64

func (*ProcessTreeManagerImpl) ReportEvent

func (ptm *ProcessTreeManagerImpl) ReportEvent(eventType utils.EventType, event utils.K8sEvent) error

func (*ProcessTreeManagerImpl) Start

func (ptm *ProcessTreeManagerImpl) Start()

Start initializes the process tree manager and starts background tasks

func (*ProcessTreeManagerImpl) Stop

func (ptm *ProcessTreeManagerImpl) Stop()

Stop shuts down the process tree manager and stops background tasks

type ProcessTreeManagerMock added in v0.2.384

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

ProcessTreeManagerMock implements the ProcessTreeManager interface for testing

func NewProcessTreeManagerMock added in v0.2.384

func NewProcessTreeManagerMock() *ProcessTreeManagerMock

NewProcessTreeManagerMock creates a new mock process tree manager

func (*ProcessTreeManagerMock) GetContainerProcessTree added in v0.2.384

func (m *ProcessTreeManagerMock) GetContainerProcessTree(containerID string, pid uint32, useCache bool) (armotypes.Process, error)

GetContainerProcessTree returns an empty process for testing

func (*ProcessTreeManagerMock) GetPidList added in v0.2.384

func (m *ProcessTreeManagerMock) GetPidList() []uint32

GetPidList returns the mock PID list

func (*ProcessTreeManagerMock) GetProcessBootTimeNs added in v0.3.167

func (m *ProcessTreeManagerMock) GetProcessBootTimeNs(pid uint32) uint64

GetProcessBootTimeNs returns the configured start time for a pid, or 0 for an unknown one — matching the real manager's "0 means unknown" contract.

func (*ProcessTreeManagerMock) ReportEvent added in v0.2.384

func (m *ProcessTreeManagerMock) ReportEvent(eventType utils.EventType, event utils.K8sEvent) error

ReportEvent is a no-op for testing

func (*ProcessTreeManagerMock) SetPidList added in v0.2.384

func (m *ProcessTreeManagerMock) SetPidList(pids []uint32)

SetPidList sets the list of PIDs that the mock will return

func (*ProcessTreeManagerMock) SetProcessBootTimeNs added in v0.3.167

func (m *ProcessTreeManagerMock) SetProcessBootTimeNs(pid uint32, ns uint64)

SetProcessBootTimeNs sets the boot-relative start time the mock reports for a pid.

func (*ProcessTreeManagerMock) Start added in v0.2.384

func (m *ProcessTreeManagerMock) Start()

Start is a no-op for testing

func (*ProcessTreeManagerMock) Stop added in v0.2.384

func (m *ProcessTreeManagerMock) Stop()

Stop is a no-op for testing

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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