metrics

package
v0.0.0-...-a6372ab Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterError

func RegisterError(err errors.AutoscalerError)

RegisterError records any errors preventing Cluster Autoscaler from working. No more than one error should be recorded per loop.

func RegisterEvictions

func RegisterEvictions(podsCount int)

RegisterEvictions records number of evicted pods

func RegisterScaleDown

func RegisterScaleDown(nodesCount int, reason NodeScaleDownReason)

RegisterScaleDown records number of nodes removed by scale down

func RegisterScaleUp

func RegisterScaleUp(nodesCount int)

RegisterScaleUp records number of nodes added by scale up

func UpdateClusterState

func UpdateClusterState(csr *clusterstate.ClusterStateRegistry)

UpdateClusterState updates metrics related to cluster state

func UpdateDuration

func UpdateDuration(label FunctionLabel, duration time.Duration)

UpdateDuration records the duration of the step identified by the label

func UpdateDurationFromStart

func UpdateDurationFromStart(label FunctionLabel, start time.Time)

UpdateDurationFromStart records the duration of the step identified by the label using start time

func UpdateLastTime

func UpdateLastTime(label FunctionLabel, now time.Time)

UpdateLastTime records the time the step identified by the label was started

func UpdateUnneededNodesCount

func UpdateUnneededNodesCount(nodesCount int)

UpdateUnneededNodesCount records number of currently unneeded nodes

func UpdateUnschedulablePodsCount

func UpdateUnschedulablePodsCount(podsCount int)

UpdateUnschedulablePodsCount records number of currently unschedulable pods

Types

type FunctionLabel

type FunctionLabel string

FunctionLabel is a name of Cluster Autoscaler operation for which we measure duration

const (
	ScaleDown                  FunctionLabel = "scaleDown"
	ScaleDownNodeDeletion      FunctionLabel = "scaleDown:nodeDeletion"
	ScaleDownFindNodesToRemove FunctionLabel = "scaleDown:findNodesToRemove"
	ScaleDownMiscOperations    FunctionLabel = "scaleDown:miscOperations"
	ScaleUp                    FunctionLabel = "scaleUp"
	FindUnneeded               FunctionLabel = "findUnneeded"
	UpdateState                FunctionLabel = "updateClusterState"
	FilterOutSchedulable       FunctionLabel = "filterOutSchedulable"
	Main                       FunctionLabel = "main"
	Poll                       FunctionLabel = "poll"
	Reconfigure                FunctionLabel = "reconfigure"
	Autoscaling                FunctionLabel = "autoscaling"
)

Names of Cluster Autoscaler operations

type HealthCheck

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

HealthCheck contains information about last time of autoscaler activity and timeout

func NewHealthCheck

func NewHealthCheck(activityTimeout, successTimeout 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

func (hc *HealthCheck) StartMonitoring()

StartMonitoring activates checks for autoscaler inactivity

func (*HealthCheck) UpdateLastActivity

func (hc *HealthCheck) UpdateLastActivity(timestamp time.Time)

UpdateLastActivity updates last time of activity

func (*HealthCheck) UpdateLastSuccessfulRun

func (hc *HealthCheck) UpdateLastSuccessfulRun(timestamp time.Time)

UpdateLastSuccessfulRun updates last time of successful (i.e. not ending in error) activity

type NodeScaleDownReason

type NodeScaleDownReason string

NodeScaleDownReason describes reason for removing node

const (

	// Underutilized node was removed because of low utilization
	Underutilized NodeScaleDownReason = "underutilized"
	// Empty node was removed
	Empty NodeScaleDownReason = "empty"
	// Unready node was removed
	Unready NodeScaleDownReason = "unready"

	// LogLongDurationThreshold defines the duration after which long function
	// duration will be logged (in addition to being counted in metric).
	// This is meant to help find unexpectedly long function execution times for
	// debugging purposes.
	LogLongDurationThreshold = 5 * time.Second
)

Jump to

Keyboard shortcuts

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