Documentation ¶
Index ¶
- Variables
- func NewCmdTop(f cmdutil.Factory, parentCommand string, streams genericclioptions.IOStreams) *cobra.Command
- func NewCmdTopPod(f cmdutil.Factory, parentCommand string, o *TopPodOptions, ...) *cobra.Command
- func SupportedMetricsAPIVersionAvailable(discoveredAPIGroups *metav1.APIGroupList) bool
- type PodMetricsSorter
- type ResourceAdder
- type ResourceMetricsInfo
- type TopCmdPrinter
- type TopPodOptions
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 NewCmdTopPod ¶
func NewCmdTopPod(f cmdutil.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 LabelSelector string FieldSelector string SortBy string AllNamespaces bool PrintContainers bool NoHeaders bool UseProtocolBuffers bool Sum bool PodClient corev1client.PodsGetter Printer *TopCmdPrinter DiscoveryClient discovery.DiscoveryInterface MetricsClient metricsclientset.Interface genericclioptions.IOStreams }
func (*TopPodOptions) RunTopPod ¶
func (o *TopPodOptions) RunTopPod() error
func (*TopPodOptions) Validate ¶
func (o *TopPodOptions) Validate() error
Click to show internal directories.
Click to hide internal directories.