resources

package
v0.0.0-...-7b41efc Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HtmlPage = `` /* 3148-byte string literal not displayed */

Functions

This section is empty.

Types

type AnalyzedValues

type AnalyzedValues struct {
	Min      util.ComputedValue
	Max      util.ComputedValue
	Avg      util.ComputedValue
	Current  util.ComputedValue
	HasValue bool
}

type ContainerValue

type ContainerValue struct {
	Name           string
	MemoryRequests AnalyzedValues
	MemoryLimits   AnalyzedValues
	CPURequests    AnalyzedValues
	CPULimits      AnalyzedValues
}

type PodValues

type PodValues struct {
	Namespace  string
	Pod        string
	Containers []ContainerValue
}

type PodValuesList

type PodValuesList struct {
	Items []PodValues
}

PodValuesList implements PrintableList

func (PodValuesList) ToHtml

func (p PodValuesList) ToHtml() string

func (PodValuesList) ToJson

func (p PodValuesList) ToJson() string

func (PodValuesList) ToTable

func (p PodValuesList) ToTable() string

type Resource

type Resource struct {
	Prometheus         prometheus.Prometheus
	KubeClient         *kubernetes.KubeClient
	Pods               []string
	Namespace          string
	LabelSelector      string
	AnnotationSelector string
	CpuMetric          string
	MemoryMetric       string
	LimitsThreshold    int
	RequestsThreshold  int
}

func (Resource) CPUUsageMetric

func (r Resource) CPUUsageMetric(matrix model.Matrix, container string) *model.SampleStream

func (Resource) Execute

func (r Resource) Execute() printer.PrintableList

func (Resource) MemoryUsageMetric

func (r Resource) MemoryUsageMetric(matrix model.Matrix, container string) *model.SampleStream

func (Resource) MetricsQuery

func (r Resource) MetricsQuery(namespace, pod string) string

Jump to

Keyboard shortcuts

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