stats

package
v1.22.3-rc.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2021 License: Apache-2.0 Imports: 30 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFakeMetricsDu added in v1.21.0

func NewFakeMetricsDu(path string, stats *volume.Metrics) volume.MetricsProvider

NewFakeMetricsDu inserts fake statistics when asked for metrics

Types

type ByCreationTime

type ByCreationTime []containerInfoWithCgroup

ByCreationTime implements sort.Interface for []containerInfoWithCgroup based on the cinfo.Spec.CreationTime field.

func (ByCreationTime) Len

func (a ByCreationTime) Len() int

func (ByCreationTime) Less

func (a ByCreationTime) Less(i, j int) bool

func (ByCreationTime) Swap

func (a ByCreationTime) Swap(i, j int)

type HostStatsProvider added in v1.21.0

type HostStatsProvider interface {
	// contains filtered or unexported methods
}

HostStatsProvider defines an interface for providing host stats associated with pod.

func NewFakeHostStatsProvider added in v1.21.0

func NewFakeHostStatsProvider() HostStatsProvider

NewFakeHostStatsProvider provides a way to test with fake host statistics

func NewFakeHostStatsProviderWithData added in v1.21.0

func NewFakeHostStatsProviderWithData(fakeStats map[string]*volume.Metrics, osInterface kubecontainer.OSInterface) HostStatsProvider

NewFakeHostStatsProviderWithData provides a way to test with fake host statistics

func NewHostStatsProvider added in v1.21.0

func NewHostStatsProvider(osInterface kubecontainer.OSInterface, podEtcHostsPathFunc PodEtcHostsPathFunc) HostStatsProvider

NewHostStatsProvider returns a new HostStatsProvider type struct.

type PodEtcHostsPathFunc added in v1.21.0

type PodEtcHostsPathFunc func(podUID types.UID) (string, bool)

PodEtcHostsPathFunc is a function to fetch a etc hosts path by pod uid and whether etc host path is supported by the runtime

type Provider added in v1.20.0

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

Provider provides the stats of the node and the pod-managed containers.

func NewCRIStatsProvider

func NewCRIStatsProvider(
	cadvisor cadvisor.Interface,
	resourceAnalyzer stats.ResourceAnalyzer,
	podManager kubepod.Manager,
	runtimeCache kubecontainer.RuntimeCache,
	runtimeService internalapi.RuntimeService,
	imageService internalapi.ImageManagerService,
	hostStatsProvider HostStatsProvider,
	disableAcceleratorUsageMetrics bool,
) *Provider

NewCRIStatsProvider returns a Provider that provides the node stats from cAdvisor and the container stats from CRI.

func NewCadvisorStatsProvider

func NewCadvisorStatsProvider(
	cadvisor cadvisor.Interface,
	resourceAnalyzer stats.ResourceAnalyzer,
	podManager kubepod.Manager,
	runtimeCache kubecontainer.RuntimeCache,
	imageService kubecontainer.ImageService,
	statusProvider status.PodStatusProvider,
	hostStatsProvider HostStatsProvider,
) *Provider

NewCadvisorStatsProvider returns a containerStatsProvider that provides both the node and the container stats from cAdvisor.

func (*Provider) GetCgroupCPUAndMemoryStats added in v1.20.0

func (p *Provider) GetCgroupCPUAndMemoryStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, error)

GetCgroupCPUAndMemoryStats returns the CPU and memory stats of the cgroup with the cgroupName. Note that this function doesn't generate filesystem stats.

func (*Provider) GetCgroupStats added in v1.20.0

func (p *Provider) GetCgroupStats(cgroupName string, updateStats bool) (*statsapi.ContainerStats, *statsapi.NetworkStats, error)

GetCgroupStats returns the stats of the cgroup with the cgroupName. Note that this function doesn't generate filesystem stats.

func (*Provider) GetContainerInfo added in v1.20.0

func (p *Provider) GetContainerInfo(podFullName string, podUID types.UID, containerName string, req *cadvisorapiv1.ContainerInfoRequest) (*cadvisorapiv1.ContainerInfo, error)

GetContainerInfo returns stats (from cAdvisor) for a container.

func (*Provider) GetRawContainerInfo added in v1.20.0

func (p *Provider) GetRawContainerInfo(containerName string, req *cadvisorapiv1.ContainerInfoRequest, subcontainers bool) (map[string]*cadvisorapiv1.ContainerInfo, error)

GetRawContainerInfo returns the stats (from cadvisor) for a non-Kubernetes container.

func (*Provider) HasDedicatedImageFs added in v1.20.0

func (p *Provider) HasDedicatedImageFs() (bool, error)

HasDedicatedImageFs returns true if a dedicated image filesystem exists for storing images.

func (*Provider) RlimitStats added in v1.20.0

func (p *Provider) RlimitStats() (*statsapi.RlimitStats, error)

RlimitStats returns base information about process count

func (*Provider) RootFsStats added in v1.20.0

func (p *Provider) RootFsStats() (*statsapi.FsStats, error)

RootFsStats returns the stats of the node root filesystem.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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