containers

package
v0.0.0-...-593c137 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NullContainerRates = ContainerRateMetrics{
	UserCPU:   -1,
	SystemCPU: -1,
	TotalCPU:  -1,
}

NullContainerRates can be safely used for containers that have no previous rate values stored (new containers)

Functions

This section is empty.

Types

type ContainerProvider

type ContainerProvider interface {
	GetContainers(cacheValidity time.Duration, previousContainers map[string]*ContainerRateMetrics) ([]*model.Container, map[string]*ContainerRateMetrics, map[int]string, error)
	GetPidToCid(cacheValidity time.Duration) map[int]string
}

ContainerProvider defines the interface for a container metrics provider

func GetSharedContainerProvider

func GetSharedContainerProvider() (ContainerProvider, error)

GetSharedContainerProvider returns a shared ContainerProvider

func InitSharedContainerProvider

func InitSharedContainerProvider(wmeta workloadmeta.Component, tagger tagger.Component) ContainerProvider

InitSharedContainerProvider init shared ContainerProvider

func NewContainerProvider

func NewContainerProvider(provider metrics.Provider, metadataStore workloadmeta.Component, filter *containers.Filter, tagger tagger.Component) ContainerProvider

NewContainerProvider returns a ContainerProvider instance

func NewDefaultContainerProvider

func NewDefaultContainerProvider(wmeta workloadmeta.Component, tagger tagger.Component) ContainerProvider

NewDefaultContainerProvider returns a ContainerProvider built with default metrics provider and metadata provider

type ContainerRateMetrics

type ContainerRateMetrics struct {
	ContainerStatsTimestamp time.Time
	NetworkStatsTimestamp   time.Time
	UserCPU                 float64
	SystemCPU               float64
	TotalCPU                float64
	IOReadBytes             float64
	IOWriteBytes            float64
	NetworkRcvdBytes        float64
	NetworkSentBytes        float64
	NetworkRcvdPackets      float64
	NetworkSentPackets      float64
}

ContainerRateMetrics holds previous values for a container, in order to compute rates

Directories

Path Synopsis
Package mock_containers is a generated GoMock package.
Package mock_containers is a generated GoMock package.

Jump to

Keyboard shortcuts

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