Skip to content

Commit 91bae6b

Browse files
authored
Merge pull request #8963 from jbtk/main_success
Add metric that is emitted after a successful single run of static autoscaler
2 parents 50f2483 + 5c03b96 commit 91bae6b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

cluster-autoscaler/loop/run.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ func RunAutoscalerOnce(autoscaler autoscaler, healthCheck *metrics.HealthCheck,
3737
if err != nil && err.Type() != errors.TransientError {
3838
metrics.RegisterError(err)
3939
} else {
40-
healthCheck.UpdateLastSuccessfulRun(time.Now())
40+
var successTime = time.Now()
41+
healthCheck.UpdateLastSuccessfulRun(successTime)
42+
metrics.UpdateLastTime(metrics.MainSuccessful, successTime)
4143
}
4244

4345
metrics.UpdateDurationFromStart(metrics.Main, loopStart)

cluster-autoscaler/metrics/metrics.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const (
110110
FilterOutSchedulable FunctionLabel = "filterOutSchedulable"
111111
CloudProviderRefresh FunctionLabel = "cloudProviderRefresh"
112112
Main FunctionLabel = "main"
113+
MainSuccessful FunctionLabel = "mainSuccessful"
113114
Poll FunctionLabel = "poll"
114115
Reconfigure FunctionLabel = "reconfigure"
115116
Autoscaling FunctionLabel = "autoscaling"

0 commit comments

Comments
 (0)