metricsutil

package
v0.0.0-...-4f3658d Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultHeapsterNamespace = "kube-system"
	DefaultHeapsterScheme    = "http"
	DefaultHeapsterService   = "heapster"
	DefaultHeapsterPort      = "" // use the first exposed port on the service
)

Variables

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

Functions

func GetHeapsterMetrics

func GetHeapsterMetrics(cli *HeapsterMetricsClient, path string, params map[string]string) ([]byte, error)

Types

type HeapsterMetricsClient

type HeapsterMetricsClient struct {
	SVCClient         coreclient.ServicesGetter
	HeapsterNamespace string
	HeapsterScheme    string
	HeapsterService   string
	HeapsterPort      string
}

func DefaultHeapsterMetricsClient

func DefaultHeapsterMetricsClient(svcClient coreclient.ServicesGetter) *HeapsterMetricsClient

func NewHeapsterMetricsClient

func NewHeapsterMetricsClient(svcClient coreclient.ServicesGetter, namespace, scheme, service, port string) *HeapsterMetricsClient

func (*HeapsterMetricsClient) GetNodeMetrics

func (cli *HeapsterMetricsClient) GetNodeMetrics(nodeName string, selector labels.Selector) ([]metricsapi.NodeMetrics, error)

func (*HeapsterMetricsClient) GetPodMetrics

func (cli *HeapsterMetricsClient) GetPodMetrics(namespace string, podName string, allNamespaces bool, selector labels.Selector) ([]metricsapi.PodMetrics, error)

type ResourceMetricsInfo

type ResourceMetricsInfo struct {
	Name      string
	Metrics   api.ResourceList
	Available api.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]api.ResourceList) error

func (*TopCmdPrinter) PrintPodMetrics

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

Jump to

Keyboard shortcuts

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