metrics

package
v0.0.0-...-67cdcee Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIServerMetrics

type APIServerMetrics testutil.Metrics

APIServerMetrics is metrics for API server

func (*APIServerMetrics) Equal

Equal returns true if all metrics are the same as the arguments.

type ClusterAutoscalerMetrics

type ClusterAutoscalerMetrics testutil.Metrics

ClusterAutoscalerMetrics is metrics for cluster autoscaler

func (*ClusterAutoscalerMetrics) Equal

Equal returns true if all metrics are the same as the arguments.

type Collection

type Collection struct {
	APIServerMetrics         APIServerMetrics
	ControllerManagerMetrics ControllerManagerMetrics
	KubeletMetrics           map[string]KubeletMetrics
	SchedulerMetrics         SchedulerMetrics
	ClusterAutoscalerMetrics ClusterAutoscalerMetrics
}

Collection is metrics collection of components

type ControllerManagerMetrics

type ControllerManagerMetrics testutil.Metrics

ControllerManagerMetrics is metrics for controller manager

func (*ControllerManagerMetrics) Equal

Equal returns true if all metrics are the same as the arguments.

type Grabber

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

Grabber provides functions which grab metrics from components

func NewMetricsGrabber

func NewMetricsGrabber(c clientset.Interface, ec clientset.Interface, kubelets bool, scheduler bool, controllers bool, apiServer bool, clusterAutoscaler bool) (*Grabber, error)

NewMetricsGrabber returns new metrics which are initialized.

func (*Grabber) Grab

func (g *Grabber) Grab() (Collection, error)

Grab returns metrics from corresponding component

func (*Grabber) GrabFromAPIServer

func (g *Grabber) GrabFromAPIServer() (APIServerMetrics, error)

GrabFromAPIServer returns metrics from API server

func (*Grabber) GrabFromClusterAutoscaler

func (g *Grabber) GrabFromClusterAutoscaler() (ClusterAutoscalerMetrics, error)

GrabFromClusterAutoscaler returns metrics from cluster autoscaler

func (*Grabber) GrabFromControllerManager

func (g *Grabber) GrabFromControllerManager() (ControllerManagerMetrics, error)

GrabFromControllerManager returns metrics from controller manager

func (*Grabber) GrabFromKubelet

func (g *Grabber) GrabFromKubelet(nodeName string) (KubeletMetrics, error)

GrabFromKubelet returns metrics from kubelet

func (*Grabber) GrabFromScheduler

func (g *Grabber) GrabFromScheduler() (SchedulerMetrics, error)

GrabFromScheduler returns metrics from scheduler

func (*Grabber) HasRegisteredMaster

func (g *Grabber) HasRegisteredMaster() bool

HasRegisteredMaster returns if metrics grabber was able to find a master node

type KubeletLatencyMetric

type KubeletLatencyMetric struct {
	// eg: list, info, create
	Operation string
	// eg: sync_pods, pod_worker
	Method string
	// 0 <= quantile <=1, e.g. 0.95 is 95%tile, 0.5 is median.
	Quantile float64
	Latency  time.Duration
}

KubeletLatencyMetric stores metrics scraped from the kubelet server's /metric endpoint. TODO: Get some more structure around the metrics and this type

type KubeletLatencyMetrics

type KubeletLatencyMetrics []KubeletLatencyMetric

KubeletLatencyMetrics implements sort.Interface for []KubeletMetric based on the latency field.

func GetDefaultKubeletLatencyMetrics

func GetDefaultKubeletLatencyMetrics(ms KubeletMetrics) KubeletLatencyMetrics

GetDefaultKubeletLatencyMetrics calls GetKubeletLatencyMetrics with a set of default metricNames identifying common latency metrics. Note that the KubeletMetrics passed in should not contain subsystem prefix.

func GetKubeletLatencyMetrics

func GetKubeletLatencyMetrics(ms KubeletMetrics, filterMetricNames sets.String) KubeletLatencyMetrics

GetKubeletLatencyMetrics filters ms to include only those contained in the metricNames set, then constructs a KubeletLatencyMetrics list based on the samples associated with those metrics.

func HighLatencyKubeletOperations

func HighLatencyKubeletOperations(c clientset.Interface, threshold time.Duration, nodeName string, logFunc func(fmt string, args ...interface{})) (KubeletLatencyMetrics, error)

HighLatencyKubeletOperations logs and counts the high latency metrics exported by the kubelet server via /metrics.

func (KubeletLatencyMetrics) Len

func (a KubeletLatencyMetrics) Len() int

func (KubeletLatencyMetrics) Less

func (a KubeletLatencyMetrics) Less(i, j int) bool

func (KubeletLatencyMetrics) Swap

func (a KubeletLatencyMetrics) Swap(i, j int)

type KubeletMetrics

type KubeletMetrics testutil.Metrics

KubeletMetrics is metrics for kubelet

func GetKubeletMetrics

func GetKubeletMetrics(c clientset.Interface, nodeName string) (KubeletMetrics, error)

GetKubeletMetrics gets all metrics in kubelet subsystem from specified node and trims the subsystem prefix.

func GrabKubeletMetricsWithoutProxy

func GrabKubeletMetricsWithoutProxy(nodeName, path string) (KubeletMetrics, error)

GrabKubeletMetricsWithoutProxy retrieve metrics from the kubelet on the given node using a simple GET over http. Currently only used in integration tests.

func NewKubeletMetrics

func NewKubeletMetrics() KubeletMetrics

NewKubeletMetrics returns new metrics which are initialized.

func (*KubeletMetrics) Equal

func (m *KubeletMetrics) Equal(o KubeletMetrics) bool

Equal returns true if all metrics are the same as the arguments.

type SchedulerMetrics

type SchedulerMetrics testutil.Metrics

SchedulerMetrics is metrics for scheduler

func (*SchedulerMetrics) Equal

Equal returns true if all metrics are the same as the arguments.

Jump to

Keyboard shortcuts

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