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
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" )