metricsutil

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type ContainerMetricsSorter added in v0.20.0

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

func NewContainerMetricsSorter added in v0.20.0

func NewContainerMetricsSorter(metrics []metricsapi.ContainerMetrics, sortBy string) *ContainerMetricsSorter

func (*ContainerMetricsSorter) Len added in v0.20.0

func (s *ContainerMetricsSorter) Len() int

func (*ContainerMetricsSorter) Less added in v0.20.0

func (s *ContainerMetricsSorter) Less(i, j int) bool

func (*ContainerMetricsSorter) Swap added in v0.20.0

func (s *ContainerMetricsSorter) Swap(i, j int)

type NodeMetricsSorter

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

func NewNodeMetricsSorter

func NewNodeMetricsSorter(metrics []metricsapi.NodeMetrics, sortBy string) *NodeMetricsSorter

func (*NodeMetricsSorter) Len

func (n *NodeMetricsSorter) Len() int

func (*NodeMetricsSorter) Less

func (n *NodeMetricsSorter) Less(i, j int) bool

func (*NodeMetricsSorter) Swap

func (n *NodeMetricsSorter) Swap(i, j int)

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 ResourceMetricsInfo

type ResourceMetricsInfo struct {
	Name      string
	Metrics   v1.ResourceList
	Available v1.ResourceList
}

type TopCmdPrinter

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

func NewTopCmdPrinter

func NewTopCmdPrinter(out io.Writer) *TopCmdPrinter

func (*TopCmdPrinter) PrintNodeMetrics

func (printer *TopCmdPrinter) PrintNodeMetrics(metrics []metricsapi.NodeMetrics, availableResources map[string]v1.ResourceList, noHeaders bool, sortBy string) error

func (*TopCmdPrinter) PrintPodMetrics

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

Jump to

Keyboard shortcuts

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