Documentation ¶
Overview ¶
Package metrics - common code for metrics of all 3 VPA components
Index ¶
Constants ¶
const ( // TopMetricsNamespace is a prefix for all VPA-related metrics namespaces TopMetricsNamespace = "vpa_" // MaxVpaSizeLog - The metrics will distinguish VPA sizes up to 2^MaxVpaSizeLog (~1M) // Anything above that size will be reported in the top bucket. MaxVpaSizeLog = 20 )
Variables ¶
This section is empty.
Functions ¶
func CreateExecutionTimeMetric ¶
func CreateExecutionTimeMetric(namespace string, help string) *prometheus.HistogramVec
CreateExecutionTimeMetric prepares a new histogram labeled with execution step
func GetVpaSizeLog2 ¶
GetVpaSizeLog2 returns a bucket number for a metric labelled with number of Pods under a given VPA. It is basically log2(vpaSize), capped to MaxVpaSizeLog
func Initialize ¶
func Initialize(address string, healthCheck *HealthCheck)
Initialize sets up Prometheus to expose metrics & (optionally) health-check on the given address
Types ¶
type ExecutionTimer ¶
type ExecutionTimer struct {
// contains filtered or unexported fields
}
ExecutionTimer measures execution time of a computation, split into major steps usual usage pattern is: timer := NewExecutionTimer(...) ; compute ; timer.ObserveStep() ; ... ; timer.ObserveTotal()
func NewExecutionTimer ¶
func NewExecutionTimer(histo *prometheus.HistogramVec) *ExecutionTimer
NewExecutionTimer provides a timer for admission latency; call ObserveXXX() on it to measure
func (*ExecutionTimer) ObserveStep ¶
func (t *ExecutionTimer) ObserveStep(step string)
ObserveStep measures the execution time from the last call to the ExecutionTimer
func (*ExecutionTimer) ObserveTotal ¶
func (t *ExecutionTimer) ObserveTotal()
ObserveTotal measures the execution time from the creation of the ExecutionTimer
type HealthCheck ¶
type HealthCheck struct {
// contains filtered or unexported fields
}
HealthCheck contains information about last activity time of the monitored component. NOTE: This started as a simplified version of ClusterAutoscaler's HealthCheck.
func NewHealthCheck ¶
func NewHealthCheck(activityTimeout time.Duration) *HealthCheck
NewHealthCheck builds new HealthCheck object with given timeout.
func (*HealthCheck) ServeHTTP ¶
func (hc *HealthCheck) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP implements http.Handler interface to provide a health-check endpoint.
func (*HealthCheck) StartMonitoring ¶ added in v1.2.0
func (hc *HealthCheck) StartMonitoring()
StartMonitoring activates checks for the component inactivity.
func (*HealthCheck) UpdateLastActivity ¶
func (hc *HealthCheck) UpdateLastActivity()
UpdateLastActivity updates last time of activity to now
Directories ¶
Path | Synopsis |
---|---|
Package admission (aka metrics_admission) - code for metrics of VPA Admission Controller plugin
|
Package admission (aka metrics_admission) - code for metrics of VPA Admission Controller plugin |
Package quality (aka metrics_quality) - code for VPA quality metrics
|
Package quality (aka metrics_quality) - code for VPA quality metrics |
Package recommender (aka metrics_recommender) - code for metrics of VPA Recommender
|
Package recommender (aka metrics_recommender) - code for metrics of VPA Recommender |
Package updater (aka metrics_updater) - code for metrics of VPA Updater
|
Package updater (aka metrics_updater) - code for metrics of VPA Updater |