metric

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelNamespace = "namespace"
	LabelPodName   = "pod"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerResourceQuery

type ContainerResourceQuery struct {
	PodResourceQuery
	ContainerName string
}

type ExternalQuery

type ExternalQuery struct {
	Namespace string
	Metric    k8sautoscalingv2.MetricIdentifier
}

type ObjectQuery

type ObjectQuery struct {
	GroupKind schema.GroupKind
	Namespace string
	Name      string
	Selector  labels.Selector
	Metric    k8sautoscalingv2.MetricIdentifier
}

type PodResourceQuery

type PodResourceQuery struct {
	Namespace    string
	Name         string
	Selector     labels.Selector
	ResourceName corev1.ResourceName
}

type Point

type Point struct {
	Timestamp prommodel.Time
	Value     float64
}

Point represents a single data point for a given timestamp.

type Query

type Query struct {
	Type                      QueryType
	PodResource               *PodResourceQuery
	ContainerResource         *ContainerResourceQuery
	WorkloadResource          *WorkloadResourceQuery
	WorkloadContainerResource *WorkloadContainerResourceQuery
	Object                    *ObjectQuery
	External                  *ExternalQuery
	WorkloadExternal          *WorkloadExternalQuery
}

Query represents a query for a specific type of metrics.

type QueryType

type QueryType string
const (
	// PodResourceQueryType is for resource metrics (such as those specified in requests and limits, e.g. CPU or memory)
	// known to Kubernetes describing each pod.
	PodResourceQueryType QueryType = "PodResource"
	// ContainerResourceQueryType is for resource metrics (such as those specified in requests and limits, e.g. CPU or memory)
	// known to Kubernetes describing a specific container in each pod.
	ContainerResourceQueryType QueryType = "ContainerResource"
	// WorkloadResourceQueryType is for resource metrics (such as those specified in requests and limits, e.g. CPU or memory)
	// known to Kubernetes describing each group of pods belonging to the same workload.
	WorkloadResourceQueryType QueryType = "WorkloadResource"
	// WorkloadContainerResourceQueryType is for resource metrics (such as those specified in requests and limits, e.g. CPU or memory)
	// known to Kubernetes describing a specific container in each group of pods belonging to the same workload.
	WorkloadContainerResourceQueryType QueryType = "WorkloadContainerResource"
	// ObjectQueryType is for metrics describing a single Kubernetes object
	// (e.g. hits-per-second on an Ingress object).
	ObjectQueryType QueryType = "Object"
	// ExternalQueryType is for global metrics that are not associated with any Kubernetes object
	// (e.g. length of queue in cloud messaging service or QPS from loadbalancer running outside of cluster).
	ExternalQueryType QueryType = "External"
	// WorkloadExternalQueryType is for global metrics describing each group of pods belonging to the same workload
	// (e.g. the total number of ready pods).
	WorkloadExternalQueryType QueryType = "WorkloadExternal"
)

type Sample

type Sample struct {
	Point
	Labels prommodel.LabelSet
	Window *time.Duration
}

Sample is a single sample belonging to a metric.

type Series

type Series struct {
	Points []Point
	Labels prommodel.LabelSet
	Window *time.Duration
}

Series is a stream of data points belonging to a metric.

type WorkloadContainerResourceQuery added in v0.2.0

type WorkloadContainerResourceQuery struct {
	WorkloadResourceQuery
	ContainerName string
}

type WorkloadExternalQuery added in v0.2.0

type WorkloadExternalQuery struct {
	GroupKind schema.GroupKind
	Namespace string
	Name      string
	Metric    k8sautoscalingv2.MetricIdentifier
}

type WorkloadResourceQuery

type WorkloadResourceQuery struct {
	GroupKind     schema.GroupKind
	Namespace     string
	Name          string
	ResourceName  corev1.ResourceName
	ReadyPodsOnly bool
}

Directories

Path Synopsis
api

Jump to

Keyboard shortcuts

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