Skip to content

Commit 85931af

Browse files
committed
remove deprecated metrics of scheduler
1 parent 447b175 commit 85931af

File tree

3 files changed

+0
-94
lines changed

3 files changed

+0
-94
lines changed

pkg/scheduler/core/generic_scheduler.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,12 @@ func (g *genericScheduler) Schedule(ctx context.Context, state *framework.CycleS
211211
}
212212
trace.Step("Running postfilter plugins done")
213213
metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPredicateEvalTime))
214-
metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationDuration.Observe(metrics.SinceInMicroseconds(startPredicateEvalTime))
215214
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
216-
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
217215

218216
startPriorityEvalTime := time.Now()
219217
// When only one node after predicate, just use it.
220218
if len(filteredNodes) == 1 {
221219
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPriorityEvalTime))
222-
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationDuration.Observe(metrics.SinceInMicroseconds(startPriorityEvalTime))
223220
return ScheduleResult{
224221
SuggestedHost: filteredNodes[0].Name,
225222
EvaluatedNodes: 1 + len(filteredNodesStatuses),
@@ -233,9 +230,7 @@ func (g *genericScheduler) Schedule(ctx context.Context, state *framework.CycleS
233230
}
234231

235232
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPriorityEvalTime))
236-
metrics.DeprecatedSchedulingAlgorithmPriorityEvaluationDuration.Observe(metrics.SinceInMicroseconds(startPriorityEvalTime))
237233
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime))
238-
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PriorityEvaluation).Observe(metrics.SinceInSeconds(startPriorityEvalTime))
239234

240235
host, err := g.selectHost(priorityList)
241236
trace.Step("Prioritizing done")

pkg/scheduler/metrics/metrics.go

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ const (
3030
SchedulerSubsystem = "scheduler"
3131
// DeprecatedSchedulingDurationName - scheduler duration metric name which is deprecated
3232
DeprecatedSchedulingDurationName = "scheduling_duration_seconds"
33-
// DeprecatedSchedulingLatencyName - scheduler latency metric name which is deprecated
34-
DeprecatedSchedulingLatencyName = "scheduling_latency_seconds"
3533

3634
// OperationLabel - operation label name
3735
OperationLabel = "operation"
@@ -76,19 +74,6 @@ var (
7674
},
7775
[]string{OperationLabel},
7876
)
79-
DeprecatedSchedulingLatency = metrics.NewSummaryVec(
80-
&metrics.SummaryOpts{
81-
Subsystem: SchedulerSubsystem,
82-
Name: DeprecatedSchedulingLatencyName,
83-
Help: "Scheduling latency in seconds split by sub-parts of the scheduling operation",
84-
// Make the sliding window of 5h.
85-
// TODO: The value for this should be based on some SLI definition (long term).
86-
MaxAge: 5 * time.Hour,
87-
StabilityLevel: metrics.ALPHA,
88-
DeprecatedVersion: "1.14.0",
89-
},
90-
[]string{OperationLabel},
91-
)
9277
E2eSchedulingLatency = metrics.NewHistogram(
9378
&metrics.HistogramOpts{
9479
Subsystem: SchedulerSubsystem,
@@ -98,16 +83,6 @@ var (
9883
StabilityLevel: metrics.ALPHA,
9984
},
10085
)
101-
DeprecatedE2eSchedulingLatency = metrics.NewHistogram(
102-
&metrics.HistogramOpts{
103-
Subsystem: SchedulerSubsystem,
104-
Name: "e2e_scheduling_latency_microseconds",
105-
Help: "E2e scheduling latency in microseconds (scheduling algorithm + binding)",
106-
Buckets: metrics.ExponentialBuckets(1000, 2, 15),
107-
StabilityLevel: metrics.ALPHA,
108-
DeprecatedVersion: "1.14.0",
109-
},
110-
)
11186
SchedulingAlgorithmLatency = metrics.NewHistogram(
11287
&metrics.HistogramOpts{
11388
Subsystem: SchedulerSubsystem,
@@ -117,16 +92,6 @@ var (
11792
StabilityLevel: metrics.ALPHA,
11893
},
11994
)
120-
DeprecatedSchedulingAlgorithmLatency = metrics.NewHistogram(
121-
&metrics.HistogramOpts{
122-
Subsystem: SchedulerSubsystem,
123-
Name: "scheduling_algorithm_latency_microseconds",
124-
Help: "Scheduling algorithm latency in microseconds",
125-
Buckets: metrics.ExponentialBuckets(1000, 2, 15),
126-
StabilityLevel: metrics.ALPHA,
127-
DeprecatedVersion: "1.14.0",
128-
},
129-
)
13095
DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration = metrics.NewHistogram(
13196
&metrics.HistogramOpts{
13297
Subsystem: SchedulerSubsystem,
@@ -137,16 +102,6 @@ var (
137102
DeprecatedVersion: "1.18.0",
138103
},
139104
)
140-
DeprecatedSchedulingAlgorithmPredicateEvaluationDuration = metrics.NewHistogram(
141-
&metrics.HistogramOpts{
142-
Subsystem: SchedulerSubsystem,
143-
Name: "scheduling_algorithm_predicate_evaluation",
144-
Help: "Scheduling algorithm predicate evaluation duration in microseconds",
145-
Buckets: metrics.ExponentialBuckets(1000, 2, 15),
146-
StabilityLevel: metrics.ALPHA,
147-
DeprecatedVersion: "1.14.0",
148-
},
149-
)
150105
DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration = metrics.NewHistogram(
151106
&metrics.HistogramOpts{
152107
Subsystem: SchedulerSubsystem,
@@ -157,16 +112,6 @@ var (
157112
DeprecatedVersion: "1.18.0",
158113
},
159114
)
160-
DeprecatedSchedulingAlgorithmPriorityEvaluationDuration = metrics.NewHistogram(
161-
&metrics.HistogramOpts{
162-
Subsystem: SchedulerSubsystem,
163-
Name: "scheduling_algorithm_priority_evaluation",
164-
Help: "Scheduling algorithm priority evaluation duration in microseconds",
165-
Buckets: metrics.ExponentialBuckets(1000, 2, 15),
166-
StabilityLevel: metrics.ALPHA,
167-
DeprecatedVersion: "1.14.0",
168-
},
169-
)
170115
SchedulingAlgorithmPreemptionEvaluationDuration = metrics.NewHistogram(
171116
&metrics.HistogramOpts{
172117
Subsystem: SchedulerSubsystem,
@@ -176,16 +121,6 @@ var (
176121
StabilityLevel: metrics.ALPHA,
177122
},
178123
)
179-
DeprecatedSchedulingAlgorithmPreemptionEvaluationDuration = metrics.NewHistogram(
180-
&metrics.HistogramOpts{
181-
Subsystem: SchedulerSubsystem,
182-
Name: "scheduling_algorithm_preemption_evaluation",
183-
Help: "Scheduling algorithm preemption evaluation duration in microseconds",
184-
Buckets: metrics.ExponentialBuckets(1000, 2, 15),
185-
StabilityLevel: metrics.ALPHA,
186-
DeprecatedVersion: "1.14.0",
187-
},
188-
)
189124
BindingLatency = metrics.NewHistogram(
190125
&metrics.HistogramOpts{
191126
Subsystem: SchedulerSubsystem,
@@ -195,16 +130,6 @@ var (
195130
StabilityLevel: metrics.ALPHA,
196131
},
197132
)
198-
DeprecatedBindingLatency = metrics.NewHistogram(
199-
&metrics.HistogramOpts{
200-
Subsystem: SchedulerSubsystem,
201-
Name: "binding_latency_microseconds",
202-
Help: "Binding latency in microseconds",
203-
Buckets: metrics.ExponentialBuckets(1000, 2, 15),
204-
StabilityLevel: metrics.ALPHA,
205-
DeprecatedVersion: "1.14.0",
206-
},
207-
)
208133
PreemptionVictims = metrics.NewHistogram(
209134
&metrics.HistogramOpts{
210135
Subsystem: SchedulerSubsystem,
@@ -307,19 +232,12 @@ var (
307232
metricsList = []metrics.Registerable{
308233
scheduleAttempts,
309234
DeprecatedSchedulingDuration,
310-
DeprecatedSchedulingLatency,
311235
E2eSchedulingLatency,
312-
DeprecatedE2eSchedulingLatency,
313236
SchedulingAlgorithmLatency,
314-
DeprecatedSchedulingAlgorithmLatency,
315237
BindingLatency,
316-
DeprecatedBindingLatency,
317238
DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration,
318-
DeprecatedSchedulingAlgorithmPredicateEvaluationDuration,
319239
DeprecatedSchedulingAlgorithmPriorityEvaluationSecondsDuration,
320-
DeprecatedSchedulingAlgorithmPriorityEvaluationDuration,
321240
SchedulingAlgorithmPreemptionEvaluationDuration,
322-
DeprecatedSchedulingAlgorithmPreemptionEvaluationDuration,
323241
PreemptionVictims,
324242
PreemptionAttempts,
325243
pendingPods,
@@ -370,7 +288,6 @@ func UnschedulablePods() metrics.GaugeMetric {
370288
// Reset resets metrics
371289
func Reset() {
372290
DeprecatedSchedulingDuration.Reset()
373-
DeprecatedSchedulingLatency.Reset()
374291
}
375292

376293
// SinceInMicroseconds gets the time since the specified start in microseconds.

pkg/scheduler/scheduler.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -540,9 +540,7 @@ func (sched *Scheduler) bind(ctx context.Context, assumed *v1.Pod, targetNode st
540540
}
541541

542542
metrics.BindingLatency.Observe(metrics.SinceInSeconds(bindingStart))
543-
metrics.DeprecatedBindingLatency.Observe(metrics.SinceInMicroseconds(bindingStart))
544543
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart))
545-
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.Binding).Observe(metrics.SinceInSeconds(bindingStart))
546544
sched.Recorder.Eventf(assumed, nil, v1.EventTypeNormal, "Scheduled", "Binding", "Successfully assigned %v/%v to %v", assumed.Namespace, assumed.Name, targetNode)
547545
return nil
548546
}
@@ -585,9 +583,7 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
585583
sched.preempt(schedulingCycleCtx, state, fwk, pod, fitError)
586584
metrics.PreemptionAttempts.Inc()
587585
metrics.SchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInSeconds(preemptionStartTime))
588-
metrics.DeprecatedSchedulingAlgorithmPreemptionEvaluationDuration.Observe(metrics.SinceInMicroseconds(preemptionStartTime))
589586
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime))
590-
metrics.DeprecatedSchedulingLatency.WithLabelValues(metrics.PreemptionEvaluation).Observe(metrics.SinceInSeconds(preemptionStartTime))
591587
}
592588
// Pod did not fit anywhere, so it is counted as a failure. If preemption
593589
// succeeds, the pod should get counted as a success the next time we try to
@@ -600,7 +596,6 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
600596
return
601597
}
602598
metrics.SchedulingAlgorithmLatency.Observe(metrics.SinceInSeconds(start))
603-
metrics.DeprecatedSchedulingAlgorithmLatency.Observe(metrics.SinceInMicroseconds(start))
604599
// Tell the cache to assume that a pod now is running on a given node, even though it hasn't been bound yet.
605600
// This allows us to keep scheduling without waiting on binding to occur.
606601
assumedPodInfo := podInfo.DeepCopy()
@@ -698,7 +693,6 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
698693

699694
err := sched.bind(bindingCycleCtx, assumedPod, scheduleResult.SuggestedHost, state)
700695
metrics.E2eSchedulingLatency.Observe(metrics.SinceInSeconds(start))
701-
metrics.DeprecatedE2eSchedulingLatency.Observe(metrics.SinceInMicroseconds(start))
702696
if err != nil {
703697
metrics.PodScheduleErrors.Inc()
704698
// trigger un-reserve plugins to clean up state associated with the reserved Pod

0 commit comments

Comments
 (0)