...

Package kubelet

import "k8s.io/kubernetes/test/e2e/framework/kubelet"
Overview
Index

Overview ▾

Index ▾

func FormatRuntimeOperationErrorRate(nodesResult map[string]NodeRuntimeOperationErrorRate) string
func GetKubeletHeapStats(ctx context.Context, c clientset.Interface, nodeName string) (string, error)
func GetKubeletPods(ctx context.Context, c clientset.Interface, node string) (*v1.PodList, error)
func GetKubeletRunningPods(ctx context.Context, c clientset.Interface, node string) (*v1.PodList, error)
func GetStatsSummary(ctx context.Context, c clientset.Interface, nodeName string) (*kubeletstatsv1alpha1.Summary, error)
func ProxyRequest(ctx context.Context, c clientset.Interface, node, endpoint string, port int) (restclient.Result, error)
func TargetContainers() []string
type ContainerResourceUsage
type ContainersCPUSummary
type NodeRuntimeOperationErrorRate
type NodesCPUSummary
type ResourceMonitor
    func NewResourceMonitor(c clientset.Interface, containerNames []string, pollingInterval time.Duration) *ResourceMonitor
    func (r *ResourceMonitor) FormatCPUSummary(summary NodesCPUSummary) string
    func (r *ResourceMonitor) FormatResourceUsage(s ResourceUsagePerNode) string
    func (r *ResourceMonitor) GetCPUSummary() NodesCPUSummary
    func (r *ResourceMonitor) GetLatest() (ResourceUsagePerNode, error)
    func (r *ResourceMonitor) GetMasterNodeCPUSummary(summaryPerNode NodesCPUSummary) NodesCPUSummary
    func (r *ResourceMonitor) GetMasterNodeLatest(usagePerNode ResourceUsagePerNode) ResourceUsagePerNode
    func (r *ResourceMonitor) LogCPUSummary()
    func (r *ResourceMonitor) LogLatest()
    func (r *ResourceMonitor) Reset()
    func (r *ResourceMonitor) Start(ctx context.Context)
    func (r *ResourceMonitor) Stop()
type ResourceUsagePerContainer
type ResourceUsagePerNode
type RuntimeOperationErrorRate
type RuntimeOperationMonitor
    func NewRuntimeOperationMonitor(ctx context.Context, c clientset.Interface) *RuntimeOperationMonitor
    func (m *RuntimeOperationMonitor) GetLatestRuntimeOperationErrorRate(ctx context.Context) map[string]NodeRuntimeOperationErrorRate
    func (m *RuntimeOperationMonitor) GetRuntimeOperationErrorRate(ctx context.Context) map[string]NodeRuntimeOperationErrorRate

Package files

kubelet_pods.go stats.go

func FormatRuntimeOperationErrorRate

func FormatRuntimeOperationErrorRate(nodesResult map[string]NodeRuntimeOperationErrorRate) string

FormatRuntimeOperationErrorRate formats the runtime operation error rate to string.

func GetKubeletHeapStats

func GetKubeletHeapStats(ctx context.Context, c clientset.Interface, nodeName string) (string, error)

GetKubeletHeapStats returns stats of kubelet heap.

func GetKubeletPods

func GetKubeletPods(ctx context.Context, c clientset.Interface, node string) (*v1.PodList, error)

GetKubeletPods retrieves the list of pods on the kubelet.

func GetKubeletRunningPods

func GetKubeletRunningPods(ctx context.Context, c clientset.Interface, node string) (*v1.PodList, error)

GetKubeletRunningPods retrieves the list of running pods on the kubelet. The pods includes necessary information (e.g., UID, name, namespace for pods/containers), but do not contain the full spec.

func GetStatsSummary

func GetStatsSummary(ctx context.Context, c clientset.Interface, nodeName string) (*kubeletstatsv1alpha1.Summary, error)

GetStatsSummary contacts kubelet for the container information.

func ProxyRequest

func ProxyRequest(ctx context.Context, c clientset.Interface, node, endpoint string, port int) (restclient.Result, error)

ProxyRequest performs a get on a node proxy endpoint given the nodename and rest client.

func TargetContainers

func TargetContainers() []string

TargetContainers returns a list of containers for which we want to collect resource usage.

type ContainerResourceUsage

ContainerResourceUsage is a structure for gathering container resource usage.

type ContainerResourceUsage struct {
    Name                    string
    Timestamp               time.Time
    CPUUsageInCores         float64
    MemoryUsageInBytes      uint64
    MemoryWorkingSetInBytes uint64
    MemoryRSSInBytes        uint64
    // The interval used to calculate CPUUsageInCores.
    CPUInterval time.Duration
}

type ContainersCPUSummary

ContainersCPUSummary is indexed by the container name with each entry a (percentile, value) map.

type ContainersCPUSummary map[string]map[float64]float64

type NodeRuntimeOperationErrorRate

NodeRuntimeOperationErrorRate is the runtime operation error rate on one node.

type NodeRuntimeOperationErrorRate map[string]*RuntimeOperationErrorRate

type NodesCPUSummary

NodesCPUSummary is indexed by the node name with each entry a ContainersCPUSummary map.

type NodesCPUSummary map[string]ContainersCPUSummary

type ResourceMonitor

ResourceMonitor manages a resourceCollector per node.

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

func NewResourceMonitor

func NewResourceMonitor(c clientset.Interface, containerNames []string, pollingInterval time.Duration) *ResourceMonitor

NewResourceMonitor returns a new ResourceMonitor.

func (*ResourceMonitor) FormatCPUSummary

func (r *ResourceMonitor) FormatCPUSummary(summary NodesCPUSummary) string

FormatCPUSummary returns the string of human-readable CPU summary from the specified summary data.

func (*ResourceMonitor) FormatResourceUsage

func (r *ResourceMonitor) FormatResourceUsage(s ResourceUsagePerNode) string

FormatResourceUsage returns the formatted string for LogLatest(). TODO(oomichi): This can be made to local function after making test/e2e/node/kubelet_perf.go use LogLatest directly instead.

func (*ResourceMonitor) GetCPUSummary

func (r *ResourceMonitor) GetCPUSummary() NodesCPUSummary

GetCPUSummary returns summary of CPU.

func (*ResourceMonitor) GetLatest

func (r *ResourceMonitor) GetLatest() (ResourceUsagePerNode, error)

GetLatest returns the latest resource usage.

func (*ResourceMonitor) GetMasterNodeCPUSummary

func (r *ResourceMonitor) GetMasterNodeCPUSummary(summaryPerNode NodesCPUSummary) NodesCPUSummary

GetMasterNodeCPUSummary returns summary of master node CPUs.

func (*ResourceMonitor) GetMasterNodeLatest

func (r *ResourceMonitor) GetMasterNodeLatest(usagePerNode ResourceUsagePerNode) ResourceUsagePerNode

GetMasterNodeLatest returns the latest resource usage of master and node.

func (*ResourceMonitor) LogCPUSummary

func (r *ResourceMonitor) LogCPUSummary()

LogCPUSummary outputs summary of CPU into log.

func (*ResourceMonitor) LogLatest

func (r *ResourceMonitor) LogLatest()

LogLatest outputs the latest resource usage into log.

func (*ResourceMonitor) Reset

func (r *ResourceMonitor) Reset()

Reset resets collectors.

func (*ResourceMonitor) Start

func (r *ResourceMonitor) Start(ctx context.Context)

Start starts collectors.

func (*ResourceMonitor) Stop

func (r *ResourceMonitor) Stop()

Stop stops collectors.

type ResourceUsagePerContainer

ResourceUsagePerContainer is map of ContainerResourceUsage

type ResourceUsagePerContainer map[string]*ContainerResourceUsage

type ResourceUsagePerNode

ResourceUsagePerNode is map of ResourceUsagePerContainer.

type ResourceUsagePerNode map[string]ResourceUsagePerContainer

type RuntimeOperationErrorRate

RuntimeOperationErrorRate is the error rate of a specified runtime operation.

type RuntimeOperationErrorRate struct {
    TotalNumber float64
    ErrorRate   float64
    TimeoutRate float64
}

type RuntimeOperationMonitor

RuntimeOperationMonitor is the tool getting and parsing docker operation metrics.

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

func NewRuntimeOperationMonitor

func NewRuntimeOperationMonitor(ctx context.Context, c clientset.Interface) *RuntimeOperationMonitor

NewRuntimeOperationMonitor returns a new RuntimeOperationMonitor.

func (*RuntimeOperationMonitor) GetLatestRuntimeOperationErrorRate

func (m *RuntimeOperationMonitor) GetLatestRuntimeOperationErrorRate(ctx context.Context) map[string]NodeRuntimeOperationErrorRate

GetLatestRuntimeOperationErrorRate gets latest error rate and timeout rate from last observed RuntimeOperationErrorRate.

func (*RuntimeOperationMonitor) GetRuntimeOperationErrorRate

func (m *RuntimeOperationMonitor) GetRuntimeOperationErrorRate(ctx context.Context) map[string]NodeRuntimeOperationErrorRate

GetRuntimeOperationErrorRate gets runtime operation records from kubelet metrics and calculate error rates of all runtime operations.