top

package
v1.8.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MeasuredResources = []corev1.ResourceName{
		corev1.ResourceCPU,
		corev1.ResourceMemory,
	}
	PodColumns      = []string{"NAME", "CLUSTER", "CPU(cores)", "MEMORY(bytes)"}
	NamespaceColumn = "NAMESPACE"
	PodColumn       = "POD"
)

Functions

func GenClusterList added in v1.8.0

func GenClusterList(clientSet karmadaclientset.Interface, clusters []string) ([]string, error)

func GetMemberAndMetricsClientSet added in v1.8.0

func GetMemberAndMetricsClientSet(f util.Factory,
	cluster string, useProtocolBuffers bool) (*kubernetes.Clientset, *metricsclientset.Clientset, error)

func NewCmdTop

func NewCmdTop(f util.Factory, parentCommand string, streams genericclioptions.IOStreams) *cobra.Command

func NewCmdTopPod

func NewCmdTopPod(f util.Factory, parentCommand string, o *TopPodOptions, streams genericclioptions.IOStreams) *cobra.Command

func SupportedMetricsAPIVersionAvailable

func SupportedMetricsAPIVersionAvailable(discoveredAPIGroups *metav1.APIGroupList) bool

Types

type PodMetricsSorter

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

func NewPodMetricsSorter

func NewPodMetricsSorter(metrics []metricsapi.PodMetrics, withNamespace bool, sortBy string) *PodMetricsSorter

func (*PodMetricsSorter) Len

func (p *PodMetricsSorter) Len() int

func (*PodMetricsSorter) Less

func (p *PodMetricsSorter) Less(i, j int) bool

func (*PodMetricsSorter) Swap

func (p *PodMetricsSorter) Swap(i, j int)

type ResourceAdder

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

func NewResourceAdder

func NewResourceAdder(resources []corev1.ResourceName) *ResourceAdder

func (*ResourceAdder) AddPodMetrics

func (adder *ResourceAdder) AddPodMetrics(m *metricsapi.PodMetrics)

AddPodMetrics adds each pod metric to the total

type ResourceMetricsInfo

type ResourceMetricsInfo struct {
	Cluster   string
	Name      string
	Metrics   corev1.ResourceList
	Available corev1.ResourceList
}

type TopCmdPrinter

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

func NewTopCmdPrinter

func NewTopCmdPrinter(out io.Writer) *TopCmdPrinter

func (*TopCmdPrinter) PrintPodMetrics

func (printer *TopCmdPrinter) PrintPodMetrics(metrics []metricsapi.PodMetrics, printContainers, withNamespace, noHeaders bool, sortBy string, sum bool) error

type TopPodOptions

type TopPodOptions struct {
	ResourceName       string
	Namespace          string
	Clusters           []string
	LabelSelector      string
	FieldSelector      string
	SortBy             string
	AllNamespaces      bool
	PrintContainers    bool
	NoHeaders          bool
	UseProtocolBuffers bool
	Sum                bool

	Printer *TopCmdPrinter

	genericclioptions.IOStreams
	// contains filtered or unexported fields
}

func (*TopPodOptions) Complete

func (o *TopPodOptions) Complete(f util.Factory, cmd *cobra.Command, args []string) error

func (*TopPodOptions) RunTopPod

func (o *TopPodOptions) RunTopPod(f util.Factory) error

func (*TopPodOptions) Validate

func (o *TopPodOptions) Validate() error

Jump to

Keyboard shortcuts

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