Merge pull request #86586 from xiaoanyunfei/cleanup/deprecate_scheduler_duration_seconds

Deprecate scheduling_duration_seconds Summary metric
This commit is contained in:
Kubernetes Prow Robot 2020-01-02 19:15:55 -08:00 committed by GitHub
commit fdfcb00ede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 13 deletions

View File

@ -220,7 +220,7 @@ func (g *genericScheduler) Schedule(ctx context.Context, state *framework.CycleS
trace.Step("Running postfilter plugins done") trace.Step("Running postfilter plugins done")
metrics.SchedulingAlgorithmPredicateEvaluationDuration.Observe(metrics.SinceInSeconds(startPredicateEvalTime)) metrics.SchedulingAlgorithmPredicateEvaluationDuration.Observe(metrics.SinceInSeconds(startPredicateEvalTime))
metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationDuration.Observe(metrics.SinceInMicroseconds(startPredicateEvalTime)) metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationDuration.Observe(metrics.SinceInMicroseconds(startPredicateEvalTime))
metrics.SchedulingLatency.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime)) metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime)) metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
startPriorityEvalTime := time.Now() startPriorityEvalTime := time.Now()
@ -243,7 +243,7 @@ func (g *genericScheduler) Schedule(ctx context.Context, state *framework.CycleS
metrics.SchedulingAlgorithmPriorityEvaluationDuration.Observe(metrics.SinceInSeconds(startPriorityEvalTime)) metrics.SchedulingAlgorithmPriorityEvaluationDuration.Observe(metrics.SinceInSeconds(startPriorityEvalTime))
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationDuration.Observe(metrics.SinceInMicroseconds(startPriorityEvalTime)) metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationDuration.Observe(metrics.SinceInMicroseconds(startPriorityEvalTime))
metrics.SchedulingLatency.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime)) metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime))
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime)) metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime))
host, err := g.selectHost(priorityList) host, err := g.selectHost(priorityList)

View File

@ -28,8 +28,8 @@ import (
const ( const (
// SchedulerSubsystem - subsystem name used by scheduler // SchedulerSubsystem - subsystem name used by scheduler
SchedulerSubsystem = "scheduler" SchedulerSubsystem = "scheduler"
// SchedulingLatencyName - scheduler latency metric name // DeprecatedSchedulingDurationName - scheduler duration metric name which is deprecated
SchedulingLatencyName = "scheduling_duration_seconds" DeprecatedSchedulingDurationName = "scheduling_duration_seconds"
// DeprecatedSchedulingLatencyName - scheduler latency metric name which is deprecated // DeprecatedSchedulingLatencyName - scheduler latency metric name which is deprecated
DeprecatedSchedulingLatencyName = "scheduling_latency_seconds" DeprecatedSchedulingLatencyName = "scheduling_latency_seconds"
@ -62,16 +62,17 @@ var (
// PodScheduleFailures counts how many pods could not be scheduled. // PodScheduleFailures counts how many pods could not be scheduled.
PodScheduleFailures = scheduleAttempts.With(metrics.Labels{"result": "unschedulable"}) PodScheduleFailures = scheduleAttempts.With(metrics.Labels{"result": "unschedulable"})
// PodScheduleErrors counts how many pods could not be scheduled due to a scheduler error. // PodScheduleErrors counts how many pods could not be scheduled due to a scheduler error.
PodScheduleErrors = scheduleAttempts.With(metrics.Labels{"result": "error"}) PodScheduleErrors = scheduleAttempts.With(metrics.Labels{"result": "error"})
SchedulingLatency = metrics.NewSummaryVec( DeprecatedSchedulingDuration = metrics.NewSummaryVec(
&metrics.SummaryOpts{ &metrics.SummaryOpts{
Subsystem: SchedulerSubsystem, Subsystem: SchedulerSubsystem,
Name: SchedulingLatencyName, Name: DeprecatedSchedulingDurationName,
Help: "Scheduling latency in seconds split by sub-parts of the scheduling operation", Help: "Scheduling latency in seconds split by sub-parts of the scheduling operation",
// Make the sliding window of 5h. // Make the sliding window of 5h.
// TODO: The value for this should be based on some SLI definition (long term). // TODO: The value for this should be based on some SLI definition (long term).
MaxAge: 5 * time.Hour, MaxAge: 5 * time.Hour,
StabilityLevel: metrics.ALPHA, StabilityLevel: metrics.ALPHA,
DeprecatedVersion: "1.18.0",
}, },
[]string{OperationLabel}, []string{OperationLabel},
) )
@ -303,7 +304,7 @@ var (
metricsList = []metrics.Registerable{ metricsList = []metrics.Registerable{
scheduleAttempts, scheduleAttempts,
SchedulingLatency, DeprecatedSchedulingDuration,
DeprecatedSchedulingLatency, DeprecatedSchedulingLatency,
E2eSchedulingLatency, E2eSchedulingLatency,
DeprecatedE2eSchedulingLatency, DeprecatedE2eSchedulingLatency,
@ -366,7 +367,7 @@ func UnschedulablePods() metrics.GaugeMetric {
// Reset resets metrics // Reset resets metrics
func Reset() { func Reset() {
SchedulingLatency.Reset() DeprecatedSchedulingDuration.Reset()
DeprecatedSchedulingLatency.Reset() DeprecatedSchedulingLatency.Reset()
} }

View File

@ -583,7 +583,7 @@ func (sched *Scheduler) bind(ctx context.Context, assumed *v1.Pod, targetNode st
metrics.BindingLatency.Observe(metrics.SinceInSeconds(bindingStart)) metrics.BindingLatency.Observe(metrics.SinceInSeconds(bindingStart))
metrics.DeprecatedBindingLatency.Observe(metrics.SinceInMicroseconds(bindingStart)) metrics.DeprecatedBindingLatency.Observe(metrics.SinceInMicroseconds(bindingStart))
metrics.SchedulingLatency.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart)) metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart))
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart)) metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart))
sched.Recorder.Eventf(assumed, nil, v1.EventTypeNormal, "Scheduled", "Binding", "Successfully assigned %v/%v to %v", assumed.Namespace, assumed.Name, targetNode) sched.Recorder.Eventf(assumed, nil, v1.EventTypeNormal, "Scheduled", "Binding", "Successfully assigned %v/%v to %v", assumed.Namespace, assumed.Name, targetNode)
return nil return nil
@ -628,7 +628,7 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
metrics.PreemptionAttempts.Inc() metrics.PreemptionAttempts.Inc()
metrics.SchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInSeconds(preemptionStartTime)) metrics.SchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInSeconds(preemptionStartTime))
metrics.DeprecatedSchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInMicroseconds(preemptionStartTime)) metrics.DeprecatedSchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInMicroseconds(preemptionStartTime))
metrics.SchedulingLatency.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime)) metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime))
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime)) metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime))
} }
// Pod did not fit anywhere, so it is counted as a failure. If preemption // Pod did not fit anywhere, so it is counted as a failure. If preemption