metrics

package
v0.0.0-...-386b7fa Latest Latest
Warning

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

Go to latest
Published: May 14, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
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"

	// APIError caused scale-up to fail
	APIError FailedScaleUpReason = "apiCallError"
	// Timeout was encountered when trying to scale-up
	Timeout FailedScaleUpReason = "timeout"

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

Variables

This section is empty.

Functions

func RegisterAll

func RegisterAll()

RegisterAll registers all metrics.

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 RegisterFailedScaleUp

func RegisterFailedScaleUp(reason FailedScaleUpReason)

RegisterFailedScaleUp records a failed scale-up operation

func RegisterNodeGroupCreation

func RegisterNodeGroupCreation()

RegisterNodeGroupCreation registers node group creation

func RegisterNodeGroupDeletion

func RegisterNodeGroupDeletion()

RegisterNodeGroupDeletion registers node group deletion

func RegisterScaleDown

func RegisterScaleDown(nodesCount int, gpuType string, reason NodeScaleDownReason)

RegisterScaleDown records number of nodes removed by scale down

func RegisterScaleUp

func RegisterScaleUp(nodesCount int, gpuType string)

RegisterScaleUp records number of nodes added by scale up

func UpdateClusterSafeToAutoscale

func UpdateClusterSafeToAutoscale(safe bool)

UpdateClusterSafeToAutoscale records if cluster is safe to autoscale

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 UpdateNapEnabled

func UpdateNapEnabled(enabled bool)

UpdateNapEnabled records if NodeAutoprovisioning is enabled

func UpdateNodeGroupsCount

func UpdateNodeGroupsCount(autoscaled, autoprovisioned int)

UpdateNodeGroupsCount records the number of node groups managed by CA

func UpdateNodesCount

func UpdateNodesCount(ready, unready, starting, longUnregistered, unregistered int)

UpdateNodesCount records the number of nodes in cluster

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 FailedScaleUpReason

type FailedScaleUpReason string

FailedScaleUpReason describes reason of failed scale-up

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"
	ScaleDownSoftTaintUnneeded FunctionLabel = "scaleDown:softTaintUnneeded"
	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 NodeGroupType

type NodeGroupType string

NodeGroupType describes node group relation to CA

type NodeScaleDownReason

type NodeScaleDownReason string

NodeScaleDownReason describes reason for removing node

Jump to

Keyboard shortcuts

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