containers

package
v0.0.0-...-6a6c459 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 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)
}

ContainerProvider defines the interface for a container metrics provider

func GetSharedContainerProvider

func GetSharedContainerProvider(wmeta workloadmeta.Component) ContainerProvider

GetSharedContainerProvider returns a shared ContainerProvider

func NewContainerProvider

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

NewContainerProvider returns a ContainerProvider instance

func NewDefaultContainerProvider

func NewDefaultContainerProvider(wmeta workloadmeta.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

Jump to

Keyboard shortcuts

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