Skip to content

Commit

Permalink
Merge pull request kubernetes#95001 from arghya88/deprecate-scheduler…
Browse files Browse the repository at this point in the history
…-metrics

deprecate scheduler metrics
  • Loading branch information
k8s-ci-robot authored Sep 24, 2020
2 parents 807db80 + 078b355 commit 44cd4fc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (pl *DefaultPreemption) PostFilter(ctx context.Context, state *framework.Cy
preemptionStartTime := time.Now()
defer func() {
metrics.PreemptionAttempts.Inc()
metrics.SchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInSeconds(preemptionStartTime))
metrics.DeprecatedSchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInSeconds(preemptionStartTime))
}()

nnn, err := pl.preempt(ctx, state, pod, m)
Expand Down
30 changes: 16 additions & 14 deletions pkg/scheduler/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,24 @@ var (
StabilityLevel: metrics.ALPHA,
},
)
SchedulingAlgorithmPreemptionEvaluationDuration = metrics.NewHistogram(
DeprecatedSchedulingAlgorithmPreemptionEvaluationDuration = metrics.NewHistogram(
&metrics.HistogramOpts{
Subsystem: SchedulerSubsystem,
Name: "scheduling_algorithm_preemption_evaluation_seconds",
Help: "Scheduling algorithm preemption evaluation duration in seconds",
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
StabilityLevel: metrics.ALPHA,
Subsystem: SchedulerSubsystem,
Name: "scheduling_algorithm_preemption_evaluation_seconds",
Help: "Scheduling algorithm preemption evaluation duration in seconds",
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
StabilityLevel: metrics.ALPHA,
DeprecatedVersion: "1.20.0",
},
)
BindingLatency = metrics.NewHistogram(
DeprecatedBindingLatency = metrics.NewHistogram(
&metrics.HistogramOpts{
Subsystem: SchedulerSubsystem,
Name: "binding_duration_seconds",
Help: "Binding latency in seconds",
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
StabilityLevel: metrics.ALPHA,
Subsystem: SchedulerSubsystem,
Name: "binding_duration_seconds",
Help: "Binding latency in seconds",
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
StabilityLevel: metrics.ALPHA,
DeprecatedVersion: "1.20.0",
},
)
PreemptionVictims = metrics.NewHistogram(
Expand Down Expand Up @@ -189,8 +191,8 @@ var (
scheduleAttempts,
e2eSchedulingLatency,
SchedulingAlgorithmLatency,
BindingLatency,
SchedulingAlgorithmPreemptionEvaluationDuration,
DeprecatedBindingLatency,
DeprecatedSchedulingAlgorithmPreemptionEvaluationDuration,
PreemptionVictims,
PreemptionAttempts,
pendingPods,
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ func (sched *Scheduler) finishBinding(prof *profile.Profile, assumed *v1.Pod, ta
return
}

metrics.BindingLatency.Observe(metrics.SinceInSeconds(start))
metrics.DeprecatedBindingLatency.Observe(metrics.SinceInSeconds(start))
prof.Recorder.Eventf(assumed, nil, v1.EventTypeNormal, "Scheduled", "Binding", "Successfully assigned %v/%v to %v", assumed.Namespace, assumed.Name, targetNode)
}

Expand Down

0 comments on commit 44cd4fc

Please sign in to comment.