Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerMetricsSnapshot ¶
type ContainerMetricsSnapshot struct { // identifies a specific container those metrics are coming from. Namespace string PodName string ContainerName string // End time of the measurement interval. SnapshotTime time.Time // Duration of the measurement interval, which is [SnapshotTime - SnapshotWindow, SnapshotTime]. SnapshotWindow time.Duration // Actual usage of the resources over the measurement interval. Usage corev1.ResourceList }
ContainerMetricsSnapshot contains information about usage of certain container within defined time window.
type MetricsClient ¶
type MetricsClient interface { // GetContainersMetrics returns an array of ContainerMetricsSnapshots, // representing resource usage for every running container in the cluster GetContainersMetrics() ([]*ContainerMetricsSnapshot, error) // GetContainersMetricsByPod returns an array of ContainerMetricsSnapshots, // representing resource usage for every running container in the given pod GetContainersMetricsByPod(podNs, podName string) ([]*ContainerMetricsSnapshot, error) }
MetricsClient provides simple metrics on resources usage on containter level.
func NewMetricsClient ¶
func NewMetricsClient(metricsGetter resourceclient.PodMetricsesGetter, namespace string) MetricsClient
NewMetricsClient creates new instance of MetricsClient, which is used by recommender. It requires an instance of PodMetricsesGetter, which is used for underlying communication with metrics server. namespace limits queries to particular namespace, use core.NamespaceAll to select all namespaces.
Click to show internal directories.
Click to hide internal directories.