kubernetes/test/e2e_node/resource_collector.go

const cadvisorImageName

const cadvisorPodName

const cadvisorPort

const houseKeepingInterval

var systemContainers

type ResourceCollector

// NewResourceCollector creates a resource collector object which collects
// resource usage periodically from Cadvisor
func NewResourceCollector(interval time.Duration) *ResourceCollector {}

// Start starts resource collector and connects to the standalone Cadvisor pod
// then repeatedly runs collectStats.
func (r *ResourceCollector) Start() {}

// Stop stops resource collector collecting stats. It does not clear the buffer
func (r *ResourceCollector) Stop() {}

// Reset clears the stats buffer of resource collector.
func (r *ResourceCollector) Reset() {}

// GetCPUSummary gets CPU usage in percentile.
func (r *ResourceCollector) GetCPUSummary() e2ekubelet.ContainersCPUSummary {}

// LogLatest logs the latest resource usage.
func (r *ResourceCollector) LogLatest() {}

// collectStats collects resource usage from Cadvisor.
func (r *ResourceCollector) collectStats(oldStatsMap map[string]*cadvisorapiv2.ContainerStats) {}

// computeContainerResourceUsage computes resource usage based on new data sample.
func computeContainerResourceUsage(name string, oldStats, newStats *cadvisorapiv2.ContainerStats) *e2ekubelet.ContainerResourceUsage {}

// GetLatest gets the latest resource usage from stats buffer.
func (r *ResourceCollector) GetLatest() (e2ekubelet.ResourceUsagePerContainer, error) {}

type resourceUsageByCPU

func (r resourceUsageByCPU) Len() int           {}

func (r resourceUsageByCPU) Swap(i, j int)      {}

func (r resourceUsageByCPU) Less(i, j int) bool {}

var percentiles

// GetBasicCPUStats returns the percentiles the cpu usage in cores for
// containerName. This method examines all data currently in the buffer.
func (r *ResourceCollector) GetBasicCPUStats(containerName string) map[float64]float64 {}

func formatResourceUsageStats(containerStats e2ekubelet.ResourceUsagePerContainer) string {}

func formatCPUSummary(summary e2ekubelet.ContainersCPUSummary) string {}

// createCadvisorPod creates a standalone cadvisor pod for fine-grain resource monitoring.
func getCadvisorPod() *v1.Pod {}

// deletePodsSync deletes a list of pods and block until pods disappear.
func deletePodsSync(ctx context.Context, f *framework.Framework, pods []*v1.Pod) {}

// newTestPods creates a list of pods (specification) for test.
func newTestPods(numPods int, volume bool, imageName, podType string) []*v1.Pod {}

// GetResourceTimeSeries gets the time series of resource usage of each container.
func (r *ResourceCollector) GetResourceTimeSeries() map[string]*perftype.ResourceSeries {}

const kubeletProcessName

func getContainerNameForProcess(name, pidFile string) (string, error) {}

// getContainer returns the cgroup associated with the specified pid.
// It enforces a unified hierarchy for memory and cpu cgroups.
// On systemd environments, it uses the name=systemd cgroup for the specified pid.
func getContainer(pid int) (string, error) {}