stats

package
v1.9.6-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 StatsProvider

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

StatsProvider 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,
) *StatsProvider

NewCRIStatsProvider returns a StatsProvider 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,
) *StatsProvider

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

func (*StatsProvider) GetCgroupStats

func (p *StatsProvider) GetCgroupStats(cgroupName string) (*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 (*StatsProvider) GetContainerInfo

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

GetContainerInfo returns stats (from cAdvisor) for a container.

func (*StatsProvider) GetRawContainerInfo

func (p *StatsProvider) 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 (*StatsProvider) RootFsStats

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

RootFsStats returns the stats of the node root filesystem.

Jump to

Keyboard shortcuts

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