Documentation
¶
Index ¶
- Constants
- Variables
- func NewBaseCollector(pollInterval int, isAnnouncer bool, callback callbacks.Callback) *baseCollector
- func RegisterCollector(collectorName string, builderFunc collectonBuilderFunc, ...)
- type ApiCollector
- func (base ApiCollector) CleanUp() error
- func (col *ApiCollector) GetContext() clients.APIContext
- func (base ApiCollector) GetPollInterval() time.Duration
- func (base ApiCollector) IsAnnouncer() bool
- func (base ApiCollector) ResetPollInterval()
- func (base ApiCollector) ScalePollInterval(factor float64)
- func (base ApiCollector) Start() error
- type CollectionConstructor
- type Collector
- func NewDPLLCollector(constructor *CollectionConstructor) (Collector, error)
- func NewDPLLFilesystemCollector(constructor *CollectionConstructor) (Collector, error)
- func NewDPLLNetlinkCollector(constructor *CollectionConstructor) (Collector, error)
- func NewDevInfoCollector(constructor *CollectionConstructor) (Collector, error)
- func NewGPSCollector(constructor *CollectionConstructor) (Collector, error)
- func NewLogsCollector(constructor *CollectionConstructor, ctx *clients.ContainerExecContext) (Collector, error)
- func NewPMCCollector(constructor *CollectionConstructor) (Collector, error)
- func NewPTPLogsCollector(constructor *CollectionConstructor) (Collector, error)
- type CollectorRegistry
- type DPLLFilesystemCollector
- func (dpll *DPLLFilesystemCollector) CleanUp() error
- func (base DPLLFilesystemCollector) GetPollInterval() time.Duration
- func (base DPLLFilesystemCollector) IsAnnouncer() bool
- func (dpll *DPLLFilesystemCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)
- func (base DPLLFilesystemCollector) ResetPollInterval()
- func (base DPLLFilesystemCollector) ScalePollInterval(factor float64)
- func (dpll *DPLLFilesystemCollector) Start() error
- type DPLLNetlinkCollector
- func (dpll *DPLLNetlinkCollector) CleanUp() error
- func (base DPLLNetlinkCollector) GetPollInterval() time.Duration
- func (base DPLLNetlinkCollector) IsAnnouncer() bool
- func (dpll *DPLLNetlinkCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)
- func (base DPLLNetlinkCollector) ResetPollInterval()
- func (base DPLLNetlinkCollector) ScalePollInterval(factor float64)
- func (dpll *DPLLNetlinkCollector) Start() error
- type DevInfoCollector
- func (ptpDev *DevInfoCollector) CleanUp() error
- func (base DevInfoCollector) GetPollInterval() time.Duration
- func (base DevInfoCollector) IsAnnouncer() bool
- func (ptpDev *DevInfoCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)
- func (base DevInfoCollector) ResetPollInterval()
- func (base DevInfoCollector) ScalePollInterval(factor float64)
- func (ptpDev *DevInfoCollector) Start() error
- type ExecCollector
- func (base ExecCollector) CleanUp() error
- func (col *ExecCollector) GetContext() clients.ExecContext
- func (base ExecCollector) GetPollInterval() time.Duration
- func (base ExecCollector) IsAnnouncer() bool
- func (base ExecCollector) ResetPollInterval()
- func (base ExecCollector) ScalePollInterval(factor float64)
- func (base ExecCollector) Start() error
- type GPSCollector
- func (base GPSCollector) CleanUp() error
- func (base GPSCollector) GetPollInterval() time.Duration
- func (base GPSCollector) IsAnnouncer() bool
- func (gps *GPSCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)
- func (base GPSCollector) ResetPollInterval()
- func (base GPSCollector) ScalePollInterval(factor float64)
- func (base GPSCollector) Start() error
- type LockedInterval
- type LogsCollector
- func (logs *LogsCollector) CleanUp() error
- func (base LogsCollector) GetPollInterval() time.Duration
- func (base LogsCollector) IsAnnouncer() bool
- func (logs *LogsCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)
- func (base LogsCollector) ResetPollInterval()
- func (base LogsCollector) ScalePollInterval(factor float64)
- func (logs *LogsCollector) SetLastPoll(pollTime time.Time)
- func (logs *LogsCollector) Start() error
- type PMCCollector
- func (base PMCCollector) CleanUp() error
- func (base PMCCollector) GetPollInterval() time.Duration
- func (base PMCCollector) IsAnnouncer() bool
- func (pmc *PMCCollector) Poll(resultsChan chan PollResult, wg *utils.WaitGroupCount)
- func (base PMCCollector) ResetPollInterval()
- func (base PMCCollector) ScalePollInterval(factor float64)
- func (base PMCCollector) Start() error
- type PollResult
Constants ¶
const ( DevInfoCollectorName = "DevInfo" DeviceInfo = "device-info" )
const ( DPLLFilesystemCollectorName = "DPLL-Filesystem" DPLLInfo = "dpll-info-fs" )
const ( DPLLNetlinkCollectorName = "DPLL-Netlink" DPLLNetlinkInfo = "dpll-info-nl" )
const ( LogsCollectorName = "Logs" LogsInfo = "log-line" )
const ( PMCCollectorName = "PMC" PMCInfo = "pmc-info" )
const ( Required collectorInclusionType = iota Optional )
const (
DPLLCollectorName = "DPLL"
)
Variables ¶
var (
GPSCollectorName = "GNSS"
)
Functions ¶
func NewBaseCollector ¶
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) GetContext ¶
func (col *ApiCollector) GetContext() clients.APIContext
func (ApiCollector) GetPollInterval ¶
func (ApiCollector) IsAnnouncer ¶
func (base ApiCollector) IsAnnouncer() bool
func (ApiCollector) ResetPollInterval ¶
func (base ApiCollector) ResetPollInterval()
func (ApiCollector) ScalePollInterval ¶
func (base ApiCollector) ScalePollInterval(factor float64)
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 (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 (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 (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) GetContext ¶
func (col *ExecCollector) GetContext() clients.ExecContext
func (ExecCollector) GetPollInterval ¶
func (ExecCollector) IsAnnouncer ¶
func (base ExecCollector) IsAnnouncer() bool
func (ExecCollector) ResetPollInterval ¶
func (base ExecCollector) ResetPollInterval()
func (ExecCollector) ScalePollInterval ¶
func (base ExecCollector) ScalePollInterval(factor float64)
type GPSCollector ¶
type GPSCollector struct { *ExecCollector // contains filtered or unexported fields }
func (GPSCollector) GetPollInterval ¶
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)
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 (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) GetPollInterval ¶
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)