provider

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

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

Go to latest
Published: Mar 12, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricsProvider

type MetricsProvider interface {
	PodMetricsProvider
	NodeMetricsProvider
}

MetricsProvider is both a PodMetricsProvider and a NodeMetricsProvider

type NodeMetricsProvider

type NodeMetricsProvider interface {
	// GetNodeMetrics gets the latest metrics for the given nodes,
	// returning both the metrics and the associated collection timestamp.
	// If a node is missing, the resourcelist should be nil for that node.
	GetNodeMetrics(nodes ...string) ([]TimeInfo, []corev1.ResourceList, error)
}

NodeMetricsProvider knows how to fetch metrics for a node.

type PodMetricsProvider

type PodMetricsProvider interface {
	// GetContainerMetrics gets the latest metrics for all containers in each listed pod,
	// returning both the metrics and the associated collection timestamp.
	// If a pod is missing, the container metrics should be nil for that pod.
	GetContainerMetrics(pods ...apitypes.NamespacedName) ([]TimeInfo, [][]metrics.ContainerMetrics, error)
}

PodMetricsProvider knows how to fetch metrics for the containers in a pod.

type TimeInfo

type TimeInfo struct {

	// Timestamp is the time at which the metrics were initially collected.
	// In the case of a rate metric, it should be the timestamp of the last
	// data point used in the calculation.  If it represents multiple metric
	// points, it should be the earliest such timestamp from all of the points.
	Timestamp time.Time

	// Window represents the window used to calculate rate metrics associated
	// with this timestamp.
	Window time.Duration
}

TimeSpan represents the timing information for a metric, which was potentially calculated over some window of time (e.g. for CPU usage rate).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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