collectors

package
v0.0.0-...-3a391b9 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: GPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DevInfoCollectorName = "DevInfo"
	DeviceInfo           = "device-info"
)
View Source
const (
	DPLLFilesystemCollectorName = "DPLL-Filesystem"
	DPLLInfo                    = "dpll-info-fs"
)
View Source
const (
	DPLLNetlinkCollectorName = "DPLL-Netlink"
	DPLLNetlinkInfo          = "dpll-info-nl"
)
View Source
const (
	LogsCollectorName = "Logs"
	LogsInfo          = "log-line"
)
View Source
const (
	PMCCollectorName = "PMC"
	PMCInfo          = "pmc-info"
)
View Source
const (
	Required collectorInclusionType = iota
	Optional
)
View Source
const (
	DPLLCollectorName = "DPLL"
)

Variables

View Source
var (
	GPSCollectorName = "GNSS"
)

Functions

func NewBaseCollector

func NewBaseCollector(
	pollInterval int,
	isAnnouncer bool,
	callback callbacks.Callback,
) *baseCollector

func RegisterCollector

func RegisterCollector(collectorName string, builderFunc collectonBuilderFunc, inclusionType collectorInclusionType)

Types

type ApiCollector

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

func NewApiCollector

func NewApiCollector(
	pollInterval int,
	isAnnouncer bool,
	callback callbacks.Callback,
	ctx clients.APIContext,
) *ApiCollector

func (ApiCollector) CleanUp

func (base ApiCollector) CleanUp() error

func (*ApiCollector) GetContext

func (col *ApiCollector) GetContext() clients.APIContext

func (ApiCollector) GetPollInterval

func (base ApiCollector) GetPollInterval() time.Duration

func (ApiCollector) IsAnnouncer

func (base ApiCollector) IsAnnouncer() bool

func (ApiCollector) ResetPollInterval

func (base ApiCollector) ResetPollInterval()

func (ApiCollector) ScalePollInterval

func (base ApiCollector) ScalePollInterval(factor float64)

func (ApiCollector) Start

func (base ApiCollector) Start() error

type CollectionConstructor

type CollectionConstructor struct {
	Callback               callbacks.Callback
	Clientset              *clients.Clientset
	ErroredPolls           chan PollResult
	PollInterval           int
	DevInfoAnnouceInterval int
	CollectorArgs          map[string]map[string]any
}

A union of all values required to be passed into all constructions

type Collector

type Collector interface {
	Start() error                                // Setups any internal state required for collection to happen
	Poll(chan PollResult, *utils.WaitGroupCount) // Poll for collectables
	CleanUp() error                              // Stops the collector and cleans up any internal state. It should result in a state that can be started again
	GetPollInterval() time.Duration              // Returns the collectors polling interval
	IsAnnouncer() bool
	ScalePollInterval(float64)
	ResetPollInterval()
}

func NewDPLLCollector

func NewDPLLCollector(constructor *CollectionConstructor) (Collector, error)

Returns a new DPLLCollector from the CollectionConstuctor Factory

func NewDPLLFilesystemCollector

func NewDPLLFilesystemCollector(constructor *CollectionConstructor) (Collector, error)

Returns a new DPLLFilesystemCollector from the CollectionConstuctor Factory

func NewDPLLNetlinkCollector

func NewDPLLNetlinkCollector(constructor *CollectionConstructor) (Collector, error)

Returns a new DPLLNetlinkCollector from the CollectionConstuctor Factory

func NewDevInfoCollector

func NewDevInfoCollector(constructor *CollectionConstructor) (Collector, error)

Returns a new DevInfoCollector from the CollectionConstuctor Factory

func NewGPSCollector

func NewGPSCollector(constructor *CollectionConstructor) (Collector, error)

Returns a new GPSCollector based on values in the CollectionConstructor

func NewLogsCollector

func NewLogsCollector(constructor *CollectionConstructor, ctx *clients.ContainerExecContext) (Collector, error)

Returns a new LogsCollector from the CollectionConstuctor Factory

func NewPMCCollector

func NewPMCCollector(constructor *CollectionConstructor) (Collector, error)

Returns a new PMCCollector based on values in the CollectionConstructor

func NewPTPLogsCollector

func NewPTPLogsCollector(constructor *CollectionConstructor) (Collector, error)

type CollectorRegistry

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

func GetRegistry

func GetRegistry() *CollectorRegistry

func (*CollectorRegistry) GetBuilderFunc

func (reg *CollectorRegistry) GetBuilderFunc(collectorName string) (collectonBuilderFunc, error)

func (*CollectorRegistry) GetOptionalNames

func (reg *CollectorRegistry) GetOptionalNames() []string

func (*CollectorRegistry) GetRequiredNames

func (reg *CollectorRegistry) GetRequiredNames() []string

type DPLLFilesystemCollector

type DPLLFilesystemCollector struct {
	*ExecCollector
	// contains filtered or unexported fields
}

func (*DPLLFilesystemCollector) CleanUp

func (dpll *DPLLFilesystemCollector) CleanUp() error

CleanUp stops a running collector

func (DPLLFilesystemCollector) GetPollInterval

func (base DPLLFilesystemCollector) GetPollInterval() time.Duration

func (DPLLFilesystemCollector) IsAnnouncer

func (base DPLLFilesystemCollector) IsAnnouncer() bool

func (*DPLLFilesystemCollector) Poll

func (dpll *DPLLFilesystemCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)

Poll collects information from the cluster then calls the callback.Call to allow that to persist it

func (DPLLFilesystemCollector) ResetPollInterval

func (base DPLLFilesystemCollector) ResetPollInterval()

func (DPLLFilesystemCollector) ScalePollInterval

func (base DPLLFilesystemCollector) ScalePollInterval(factor float64)

func (*DPLLFilesystemCollector) Start

func (dpll *DPLLFilesystemCollector) Start() error

Start sets up the collector so it is ready to be polled

type DPLLNetlinkCollector

type DPLLNetlinkCollector struct {
	*ExecCollector
	// contains filtered or unexported fields
}

func (*DPLLNetlinkCollector) CleanUp

func (dpll *DPLLNetlinkCollector) CleanUp() error

CleanUp stops a running collector

func (DPLLNetlinkCollector) GetPollInterval

func (base DPLLNetlinkCollector) GetPollInterval() time.Duration

func (DPLLNetlinkCollector) IsAnnouncer

func (base DPLLNetlinkCollector) IsAnnouncer() bool

func (*DPLLNetlinkCollector) Poll

func (dpll *DPLLNetlinkCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)

Poll collects information from the cluster then calls the callback.Call to allow that to persist it

func (DPLLNetlinkCollector) ResetPollInterval

func (base DPLLNetlinkCollector) ResetPollInterval()

func (DPLLNetlinkCollector) ScalePollInterval

func (base DPLLNetlinkCollector) ScalePollInterval(factor float64)

func (*DPLLNetlinkCollector) Start

func (dpll *DPLLNetlinkCollector) Start() error

Start sets up the collector so it is ready to be polled

type DevInfoCollector

type DevInfoCollector struct {
	*ExecCollector
	// contains filtered or unexported fields
}

func (*DevInfoCollector) CleanUp

func (ptpDev *DevInfoCollector) CleanUp() error

CleanUp stops a running collector

func (DevInfoCollector) GetPollInterval

func (base DevInfoCollector) GetPollInterval() time.Duration

func (DevInfoCollector) IsAnnouncer

func (base DevInfoCollector) IsAnnouncer() bool

func (*DevInfoCollector) Poll

func (ptpDev *DevInfoCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)

Poll collects information from the cluster then calls the callback.Call to allow that to persist it

func (DevInfoCollector) ResetPollInterval

func (base DevInfoCollector) ResetPollInterval()

func (DevInfoCollector) ScalePollInterval

func (base DevInfoCollector) ScalePollInterval(factor float64)

func (*DevInfoCollector) Start

func (ptpDev *DevInfoCollector) Start() error

Start sets up the collector so it is ready to be polled

type ExecCollector

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

func NewExecCollector

func NewExecCollector(
	pollInterval int,
	isAnnouncer bool,
	callback callbacks.Callback,
	ctx clients.ExecContext,
) *ExecCollector

func (ExecCollector) CleanUp

func (base ExecCollector) CleanUp() error

func (*ExecCollector) GetContext

func (col *ExecCollector) GetContext() clients.ExecContext

func (ExecCollector) GetPollInterval

func (base ExecCollector) GetPollInterval() time.Duration

func (ExecCollector) IsAnnouncer

func (base ExecCollector) IsAnnouncer() bool

func (ExecCollector) ResetPollInterval

func (base ExecCollector) ResetPollInterval()

func (ExecCollector) ScalePollInterval

func (base ExecCollector) ScalePollInterval(factor float64)

func (ExecCollector) Start

func (base ExecCollector) Start() error

type GPSCollector

type GPSCollector struct {
	*ExecCollector
	// contains filtered or unexported fields
}

func (GPSCollector) CleanUp

func (base GPSCollector) CleanUp() error

func (GPSCollector) GetPollInterval

func (base GPSCollector) GetPollInterval() time.Duration

func (GPSCollector) IsAnnouncer

func (base GPSCollector) IsAnnouncer() bool

func (*GPSCollector) Poll

func (gps *GPSCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)

Poll collects information from the cluster then calls the callback.Call to allow that to persist it

func (GPSCollector) ResetPollInterval

func (base GPSCollector) ResetPollInterval()

func (GPSCollector) ScalePollInterval

func (base GPSCollector) ScalePollInterval(factor float64)

func (GPSCollector) Start

func (base GPSCollector) Start() error

type LockedInterval

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

func NewLockedInterval

func NewLockedInterval(seconds int) *LockedInterval

type LogsCollector

type LogsCollector struct {
	*ApiCollector
	// contains filtered or unexported fields
}

LogsCollector collects logs from repeated calls to the kubeapi with overlapping query times, the lines are then fed into a channel, in another goroutine they are de-duplicated and written to an output file.

Overlap: cmd followDuration |---------------| since cmd followDuration |---------------|---------------| .............. since cmd followDuration .............. |---------------|---------------|

This was done because oc logs and the kubeapi endpoint which it uses does not look back over a log rotation event, nor does it continue to follow.

Log aggregators would be preferred over this method however this requires extra infra which might not be present in the environment.

func (*LogsCollector) CleanUp

func (logs *LogsCollector) CleanUp() error

CleanUp stops a running collector

func (LogsCollector) GetPollInterval

func (base LogsCollector) GetPollInterval() time.Duration

func (LogsCollector) IsAnnouncer

func (base LogsCollector) IsAnnouncer() bool

func (*LogsCollector) Poll

func (logs *LogsCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)

Poll collects log lines

func (LogsCollector) ResetPollInterval

func (base LogsCollector) ResetPollInterval()

func (LogsCollector) ScalePollInterval

func (base LogsCollector) ScalePollInterval(factor float64)

func (*LogsCollector) SetLastPoll

func (logs *LogsCollector) SetLastPoll(pollTime time.Time)

func (*LogsCollector) Start

func (logs *LogsCollector) Start() error

Start sets up the collector so it is ready to be polled

type PMCCollector

type PMCCollector struct {
	*ExecCollector
}

func (PMCCollector) CleanUp

func (base PMCCollector) CleanUp() error

func (PMCCollector) GetPollInterval

func (base PMCCollector) GetPollInterval() time.Duration

func (PMCCollector) IsAnnouncer

func (base PMCCollector) IsAnnouncer() bool

func (*PMCCollector) Poll

func (pmc *PMCCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)

Poll collects information from the cluster then calls the callback.Call to allow that to persist it

func (PMCCollector) ResetPollInterval

func (base PMCCollector) ResetPollInterval()

func (PMCCollector) ScalePollInterval

func (base PMCCollector) ScalePollInterval(factor float64)

func (PMCCollector) Start

func (base PMCCollector) Start() error

type PollResult

type PollResult struct {
	CollectorName string
	Errors        []error
}

Directories

Path Synopsis
Devices collected methods for getting device information from a system under test
Devices collected methods for getting device information from a system under test

Jump to

Keyboard shortcuts

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