admission

package
v0.0.0-...-34f7b3f Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: GPL-3.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package admission (aka metrics_admission) - code for metrics of VPA Admission Controller plugin

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OnAdmittedPod

func OnAdmittedPod(touched bool)

OnAdmittedPod increases the counter of pods handled by VPA Admission Controller

func Register

func Register()

Register initializes all metrics for VPA Admission Contoller

Types

type AdmissionLatency

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

AdmissionLatency measures latency / execution time of Admission Control execution usual usage pattern is: timer := NewAdmissionLatency() ; compute ; timer.Observe()

func NewAdmissionLatency

func NewAdmissionLatency() *AdmissionLatency

NewAdmissionLatency provides a timer for admission latency; call Observe() on it to measure

func (*AdmissionLatency) Observe

func (t *AdmissionLatency) Observe(status AdmissionStatus, resource AdmissionResource)

Observe measures the execution time from when the AdmissionLatency was created

type AdmissionResource

type AdmissionResource string

AdmissionResource describes the resource processed by Admission Control execution

const (
	// Unknown means that the resource could not be determined
	Unknown AdmissionResource = "unknown"
	// Pod means Kubernetes Pod
	Pod AdmissionResource = "Pod"
	// Vpa means VerticalPodAutoscaler object (CRD)
	Vpa AdmissionResource = "VPA"
)

type AdmissionStatus

type AdmissionStatus string

AdmissionStatus describes the result of Admission Control execution

const (
	// Error denotes a failed Admission Control execution
	Error AdmissionStatus = "error"
	// Skipped denotes an Admission Control execution w/o applying a recommendation
	Skipped AdmissionStatus = "skipped"
	// Applied denotes an Admission Control execution when a recommendation was applied
	Applied AdmissionStatus = "applied"
)

Jump to

Keyboard shortcuts

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