package metrics

import "k8s.io/kubernetes/pkg/controller/podautoscaler/metrics"

Index

Constants

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

Types

type HeapsterMetricsClient

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

HeapsterMetricsClient is Heapster-based implementation of MetricsClient

func NewHeapsterMetricsClient

func NewHeapsterMetricsClient(client clientset.Interface, namespace, scheme, service, port string) *HeapsterMetricsClient

NewHeapsterMetricsClient returns a new instance of Heapster-based implementation of MetricsClient interface.

func (*HeapsterMetricsClient) GetCPUUtilization

func (h *HeapsterMetricsClient) GetCPUUtilization(namespace string, selector labels.Selector) (*int, time.Time, error)

func (*HeapsterMetricsClient) GetCpuConsumptionAndRequestInMillis

func (h *HeapsterMetricsClient) GetCpuConsumptionAndRequestInMillis(namespace string, selector labels.Selector) (avgConsumption int64,
	avgRequest int64, timestamp time.Time, err error)

func (*HeapsterMetricsClient) GetCustomMetric

func (h *HeapsterMetricsClient) GetCustomMetric(customMetricName string, namespace string, selector labels.Selector) (*float64, time.Time, error)

GetCustomMetric returns the average value of the given custom metric from the pods picked using the namespace and selector passed as arguments.

type MetricsClient

type MetricsClient interface {
	// GetCPUUtilization returns the average utilization over all pods represented as a percent of requested CPU
	// (e.g. 70 means that an average pod uses 70% of the requested CPU)
	// and the time of generation of the oldest of utilization reports for pods.
	GetCPUUtilization(namespace string, selector labels.Selector) (*int, time.Time, error)

	// GetCustomMetric returns the average value of the given custom metrics from the
	// pods picked using the namespace and selector passed as arguments.
	GetCustomMetric(customMetricName string, namespace string, selector labels.Selector) (*float64, time.Time, error)
}

MetricsClient is an interface for getting metrics for pods.

Source Files

metrics_client.go

Version
v1.4.1-beta.0
Published
Sep 26, 2016
Platform
js/wasm
Imports
12 packages
Last checked
1 minute ago

Tools for package owners.